Forum Moderators: phranque

Message Too Old, No Replies

htaccess help

How do I effectively rewrite to another domain?

         

FiRe

12:32 pm on Feb 20, 2008 (gmt 0)

10+ Year Member



I have set up site.com and basically all pages need to be read from blah.com using htaccess, i.e:

http://www.site.com/about.php

Will load the page from

http://www.blah.com/about.php

NOT redirect it!

This is what I have got but does not work, any ideas?

RewriteEngine On
RewriteRule ^(.*) http://www.blah.com/$1 [P]

[edited by: jdMorgan at 5:32 am (utc) on Feb. 21, 2008]
[edit reason] de-linked [/edit]

FiRe

12:37 pm on Feb 20, 2008 (gmt 0)

10+ Year Member



Ok I have this:

RewriteEngine On
RewriteRule ^(.*)$ http://www.blah.com/$1

But it is still redirecting, I need the URL to stay in the browser. Any ideas?

[edited by: jdMorgan at 5:33 am (utc) on Feb. 21, 2008]
[edit reason] de-linked [/edit]

jdMorgan

5:30 am on Feb 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unless both sites are hosted in the same filespace in the same server, you'll either need to redirect (which involves the browser and is therefore visible), or you'll need mod_proxy enabled to proxy the requests from the site.com server over to the blah.com server. However, that other server will "see" all such proxied requests as coming from your server.

See the RewriteRule [P] flag.

Jim