Forum Moderators: phranque
example.com/index.php to example2.com/example/index.php
the thing is, I don't want the address bar to show the redirection.
is this possible?
current code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.example\.com¦example\.com)$ [NC]
RewriteRule (.*) http://example2.com/example/$1 [R]
Are all these domains pointed to the same server directory space?
If not, you'll have to proxy all requests from example2.com over to example.com which means both servers will have to handle each requests, and the stats on example.com will always show example2.com as the requestor, making the stats reports rather useless.
In most cases the hassle and maintenance costs due to increased complexity aren't worth it.
Jim
Although you're not using a subdomain, the code is pretty much identical -- all you need to do is to change the domain name in the code where it tests for %{HTTP_HOST} and test for your "parked" domain instead of a subdomain.
Jim
if the request is coming from example.com make sure it is already in the example sub directory
example.com/page.php to example.com/example/page.php
example.com/example/anotherpage.php wouldn't be altered because the request is already in the subdirectory
this is my attempted code which returns a 500 error
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.example\.com¦example\.com)$ [NC]
RewriteCond %{REQUEST_URI} !^example\/
RewriteRule (.*) /example/$1