Forum Moderators: phranque

Message Too Old, No Replies

.htacess and subdomains accessing files from one level up

i want to access php files from main when on the subdomain

         

slh012

2:31 pm on Feb 27, 2008 (gmt 0)

10+ Year Member



Hi have a site on
[sub.main.com...]

directory structure is

home/user/main/sub/

i want to access php files from main when on the subdomain.

this doesnt work
RewriteRule ^page.php$ ../page.php [L,QSA]

any suggestions?

gergoe

6:03 pm on Feb 27, 2008 (gmt 0)

10+ Year Member



Yep, that's not going to work. You either need to turn your subdomain into a virtual one by altering the main domain's configuration, or you will need to make an Alias for that directory, or even better, put the "shared" php files into a separate directory, and make an Alias for that directory, then you can use it in the same way in both websites. The problem is that in either case you need to have access to the server configuration files.

And last, you can solve it by making an empty php file, which only includes the one from the main domain, but that depends on the php settings (if it's allowed or not).

slh012

8:13 pm on Feb 27, 2008 (gmt 0)

10+ Year Member



thanks for the response gergoe

I have access to the server.

Our server management guys suggested that i can use a symlink, however, I wanted to eliminate the possibility of solving it with htacess, that seems unlikely now.

i'll look into your suggestions tomorrow.

thanks for your help, any other suggestions out there?