The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

    Joined:
    Jan 8, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,694
    Likes Received:
    654
    Trophy Points:
    113
    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:

    /usr/local/apache/htdocs/ptwebsiteengine/

    It will be:

    /home/username/public_html/ptwebsiteengine/

    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.
     
Loading...
Similar Threads - Migrating several websites
  1. odine16
    Replies:
    1
    Views:
    845

Share This Page