Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Internal Not External ReWrite Required

3:44 pm on Apr 7, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 31, 2003
votes: 0

I can do an external rewrite from one host to another fine:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com
RewriteRule .* [www2.domain.com%{REQUEST_URI}...] [L]

However I want 'www' to stay in the address bar, while 'www2' is the site that is queried.

I read that you just need to remove the http:// to make it internal, e.g.:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com
RewriteRule .* www2.domain.com%{REQUEST_URI} [L]

But this gives me a 400 bad request - any ideas?

8:11 pm on Apr 7, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0

By definition, you can't internally rewrite to a different domain.

If you want to server content from another server under the originally-requested URL, see Apache mod_proxy.