Forum Moderators: phranque

Message Too Old, No Replies

localhost internal redirects

one testing server/multiple sites

         

Josefu

1:12 pm on Apr 2, 2006 (gmt 0)

10+ Year Member



I've got Apache running on my a local machine that I use for a test server. I've got a few sites to maintain now, and until present I've simply renamed folders (to make it 'root') when I wanted to test.

I am using php with many [DOCUMENT_ROOT] commands in most all of my sites. Would there be some way I could set up an .htaccess file in the server rood that would redirect internal requests from a sub-directory back to the same directory - but as if it was root? I hope I was clear there.

I've tried the below:

RewriteCond %{REQUEST_URI} ^/subdirectory/.*
RewriteRule ^(.*)$ /subdirectory/$1 [L]

...but no dice. Can someone please point me in the right direction on this? Thanks in advance.

extras

7:23 pm on Apr 2, 2006 (gmt 0)

10+ Year Member



I don't think there is a way to set different DOCUMENT_ROOT with mod_rewrite.
If there is one, I'd like to know, too.

Why don't you use mod_vhost_alias or simply <virtualhost ...>?

You may want to read this link for more info.
[sitepoint.com...]

To Jim: If the link above isn't appropriate, please remove.
I just hated to copy and paste all info gathered there.

Josefu

8:32 pm on Apr 2, 2006 (gmt 0)

10+ Year Member



I just returned to say that I found the wonders of <virtualhost> - I was searching with the wrong keywords and thinking past the problem - as usual. Thanks for the link!