ex1.com domain to ex2.com domain rewriting (not redirecting)

Discuss practical ways rearrange URLs using mod_rewrite.

ex1.com domain to ex2.com domain rewriting (not redirecting)

Postby brAndy » Wed Mar 30, 2005 1:55 am

I need to redirect ex2.com to ex1.com, but(!) not to change the url, that user sees.

I mean
RewriteEngine On
RewriteCond %{HTTP_HOST} ex2\.com
RewriteRule ^(.*) http://ex1.com/$1 [R=301,L]

is NOT what I'm looking for.
it redirects ex2.com to ex1.com. But I need user to think that he is at ex2.com

Thanks
brAndy
 

Postby Caterham » Wed Mar 30, 2005 5:34 am

Use PorxyPass, mod_proxy is required; this will cause traffic for ex2.com and ex1.com

RewriteEngine On
RewriteCond %{HTTP_HOST} ex2\.com
RewriteRule ^(.*) http://ex1.com/$1 [P,L]
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby brAndy » Wed Mar 30, 2005 11:54 pm

thnx
brAndy
 


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 19 guests

cron