[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Website Forwarding on RaQ2 without a virtual site



On Fri, 26 Nov 1999, cobalt-users@xxxxxxxxxxxxxxx wrote:

> I am looking for a way to setup domains on my RaQ2 (with the respective dns
> entries) so that when the server gets a request for that website it just
> forwards to an url outside of it.

Try this:

replace the first RewriteRule of the first (!) VirtualHost of the IP
you want:

NameVirtualHost a.b.c.d
<VirtualHost a.b.c.d>
[...]
# old
#RewriteRule ^/(.*)			http://www.site.com/$1 [L,R]
[...]
# new
RewriteMap forward			txt:/etc/httpd/conf/forward
RewriteRule ^/(.*)			${forward:%{HTTP_HOST}}/$1
[...]
</VirtualHost>

then create the file /etc/httpd/conf/forward with this content

www.domain.com			http://www.otherdomain.com/here


Then all requests to www.domain.com will automatically be forwarded to
www.otherdomain.com/here


Hope this helps.

-- 
Dominik - http://www.saargate.de/~domi/