tags:

views:

125

answers:

2

Hello!

I want to redirect www.mydomain.com/store to http://store.anotherdomain.com/me

When I use RewriteRule ^store$ http://store.anotherdomain.com/me it ends up redirecting, meaning the URL changes, rather than remaining www.mydomain.com/store

What do I need it to do to do the rewrite properly?

When I use RewriteRule ^next$ /mydomain/subfolder/subfolder/subfolder is seems to work fine.

+1  A: 
RewriteRule ^store$ http://store.anotherdomain.com/me [P]

Note the [P] at the end. You'll also need to have the mod_proxy module enabled.

earl
+1  A: 

You don't need mod_rewrite at all.

You need to enable mod_proxy and configure a reverse proxy. You can even pass cookies from the other domain and make them look as if they were from your site.

ProxyPass /store/ http://store.anotherdomain.com/me/
ProxyPassReverse /store/ http://store.anotherdomain.com/me/
ProxyPassReverseCookieDomain store.anotherdomain.com www.mydomain.com
ProxyPassReverseCookiePath /me/ /store/
oscargm