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!

different "names" for the same directory

Discussion in 'General Discussion' started by brentmeister, Aug 11, 2005.

  1. brentmeister

    brentmeister Registered

    Aug 11, 2005
    Likes Received:
    Trophy Points:

    I have a directory in my public_html which contains the PHP code for my site.

    I want to reuse the code for lots of sites sitting under my sinlge domain, but I dont want to make separate copies of the code base.

    So for example:

    http://www.mydomain/site1/ will use the same code as http://www.mydomain/site2/

    However, the code needs to recoginise exactly which site the user is requesting, site1 or site2

    Is there a way of doing this WITHOUT adding a query string to the URL such as site_id=1?

    Ideally I would like to put a switch in the code so that it determines the site from the $_SERVER['PHP_SELF'] variable.

    However, redirecting in Cpanel doesn't achieve this as it actually changes the request to whatever you are redirecting to.

    I hope you understand what I'm trying to do...its a little tricky to explain, and currently I'm scratching my head a lot! :confused:

    Any thoughts? all help appreciated! :)

  2. shashank

    shashank Well-Known Member

    Apr 12, 2003
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    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