Redirect subfolder to another domain

New to mod_rewrite? This is a good place to start.

Redirect subfolder to another domain

Postby skione » Tue Jun 10, 2008 5:10 am

I need a mod rewrite rule that will do the following:

domain.com/subfolder shows content located at domain2.com

I would like the URL in the address bar to remain domain.com/subfolder

Or as close to this as I can get.

Thanks.

OK so I realize that i need mod_rewrite and mod_proxy.

I set up an .htaccess file in the folder where I wanted to redirect with the following contents:
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^\.?$ http://domain2.com/ [NC,P,L]

But now all referential links on the redirected domain are broken.

Help please?

In the end this did it:

ProxyPass /dev1/ http://www.domain2.com/
ProxyPassReverse / http://www.domain2.com/

I added this to the conf file for the vhost.
skione
 
Posts: 1
Joined: Tue Jun 10, 2008 5:07 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 33 guests

cron