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.

different "names" for the same directory

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

  1. brentmeister

    brentmeister Registered

    Joined:
    Aug 11, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    hello

    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! :)

    Brentmeister
     
  2. shashank

    shashank Well-Known Member
    PartnerNOC

    Joined:
    Apr 12, 2003
    Messages:
    159
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page