Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Migrating several websites with same web root using mod-rewrite...

Discussion in 'Migrate to cPanel' started by ebraden, Jan 8, 2013.

  1. ebraden

    ebraden Registered

    Jan 8, 2013
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    We are currently on a generic (no cPanel, Plesk, etc) LAMP server running Redhat and on this system that we are migrating onto cPAnel from, we have a single php code base with one database that supports about 15 different domains.

    All these 15 domains are pointing to the same webroot e.g., /usr/local/apache/htdocs/ptwebsiteengine/ and we are using apache's mod-rewrite to send each domain to the appropriate index.php file e.g, RewriteRule ^/$ /websites/30/index.php

    I am having trouble figuring out how to implement this scheme in the WHM/cPanel environment and have actually started looking at implementing this outside of the WHM/cPanel environment by setting up the webroot in /usr/local/apache/htdocs/websites/ptwebsiteengine and working with apache include files to tell apache about it.

    Can I do this in the WMH/cPanel environment or must I create this scheme outside of WHM/cPanel?
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello :)

    I recommend reassessing the current structure you have in place for your domain names. Do you want all of the domain names under the same account? If so, you can create a cPanel account, and add these domain names as "Addon" domains. In addition, you should update your scripts and mod_rewrite rules to reflect the paths that will be used on the cPanel server. So, instead of:


    It will be:


    Updating your scripts and rewrite rules will be much easier than trying to implement a custom solution to workaround the standard cPanel configuration.

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice