domains in subfolder - problem with a php script

Using a single web hosting account to host multiple sites

domains in subfolder - problem with a php script

Postby modnewbie » Fri Mar 30, 2007 9:10 pm

hello richardk

i am a newbie in all the mod rewrite topics and hope that you might be able to help me with following:

i have multiple domains via ip pointing into a rootfolder. from the rootfolder the domains are forwarded into subfolders.

currently htaccess file is as follows (there are more domains but shortened here - they all look the same):

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
# This is an auto generated content. DO NOT CHANGE IT!
# domain1.com (/domain1)
RewriteCond %{HTTP_HOST} domain1.com
RewriteCond %{REQUEST_URI} !domain1/
RewriteRule ^(.*)$ domain1/$1
# End of auto generated content

# This is an auto generated content. DO NOT CHANGE IT!
# domain2.com (/domain2)
RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !domain2/
RewriteRule ^(.*)$ domain2/$1
# End of auto generated content

# This is an auto generated content. DO NOT CHANGE IT!
# domain3.com (/domain3)
RewriteCond %{HTTP_HOST} domain3.com
RewriteCond %{REQUEST_URI} !domain3/
RewriteRule ^(.*)$ domain3/$1
# End of auto generated content

all domains resolve into given subdirectory and work fine.

now i installed a php script which has to be in a root directory. i thought this should work fine in the domains subdirectory but now the script is looking for it's direcotries in the root directory instead of the domains given subdirecotry.

for example the script uses templates and is looking for the template directory in the path
/usr/www/users/mypath/root/templates/

instead of

/usr/www/users/mypath/root/domain2/templates/

the script seems to look for all directories in the root and so far i was not able to make it look in the domains "redirected" root directory.

do you have any idea how i can solve this? i can not move the domain into the root as in the root i have an other domain which i can not change.

hope you can help. many thanks in advance.
modnewbie
 
Posts: 1
Joined: Fri Mar 30, 2007 8:55 pm

Postby richardk » Sun Apr 01, 2007 1:56 pm

Mod_rewrite cannot rewrite requests made by PHP. Does the script not allow you to change the base path (a configuration setting)? If it doesn't, you will need to add the following to the top of all scripts that people will go to (not included files)
Code: Select all
$_SERVER['DOCUMENT_ROOT'] = '/usr/www/users/mypath/root/domain2/templates';
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 36 guests

cron