>> RewriteCond %{HTTP_HOST} ^dodo\.foo\.com$
>> RewriteRule ^/bar/(.*) /$1 [R,L]
>>
>> RewriteCond %{HTTP_HOST} ^dodo\.foo\.com$
>> RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
>> RewriteRule ^dodo\.foo\.com/(.*) http://foo.com/bar/$1 [P]
>>
> Also, in your example above, for me instinctively the last 3 rules look
> like you are doing some extra work that should not be necessary :
> - you test if the host name is "dodo.foo.com"
> - then you modify the URL to add this hostname in front of the URL
> - only to strip it out again and redirect to "foo.com/bar/" with a proxy
> rule
Good point. I'll have to see if I can combine them, I based those two rules on
an example, but I may be able to get away with
RewriteCond %{HTTP_HOST} ^dodo\.foo\.com$
RewriteRule ^(.*) http://foo.com/bar/$1 [P]
There are a couple other issues:
1. minor performance issue: all CSS and javascript etc (which all start with
/bar/ in URL) do not need a redirect so I should probably filter those out if
possible
2. major issue: form POST problem: form POST should probably not get redirected
either, but so far I can't find what condition to test for
> Considering your latest answer, I am also now inclined to think that
> using <VirtualHost> sections would be much cleaner.
More efficient, more maintainable, or less code to write to obtain same effect?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [email protected]
" from the digest: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [email protected]
" from the digest: [email protected]
For additional commands, e-mail: [email protected]