homepage Welcome to WebmasterWorld Guest from 54.198.8.124
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Internal Not External ReWrite Required
papamaku




msg:1519668
 3:44 pm on Apr 7, 2005 (gmt 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?

 

jdMorgan




msg:1519669
 8:11 pm on Apr 7, 2005 (gmt 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.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved