[OSM-talk] [OT] mod_rewrite
Jon Burgess
jburgess777 at googlemail.com
Wed Dec 12 22:15:14 GMT 2007
On Wed, 2007-12-12 at 21:47 +0000, Nick Whitelegg wrote:
> Hello everyone,
>
> Am trying to set up a mod_rewrite rule to map
>
> http://newforest.free-map.org.uk/
>
> to
>
> http://www.free-map.org.uk/newforest/
>
> According to various things I've read this ought to do it :
>
> RewriteCond %{HTTP_HOST} ^http://newforest.free-map.org.uk%$
> RewriteRule ^(.*)$ http://www.free-map.org.uk/newforest/$1
>
> However this does not work - I get the error "can't find host
> newforest.free-map.org.uk". Is there something else I need to configure to
> say that the host newforest.free-map.org.uk is the same as
> www.free-map.org.uk?
>
> Thanks,
> Nick
I'd have thought that you should do this by changing the VirtualHost
setup instead of mod_rewrite,
from http://httpd.apache.org/docs/2.2/vhosts/name-based.html
"Many servers want to be accessible by more than one name. This is
possible with the ServerAlias directive, placed inside the <VirtualHost>
section. For example in the first <VirtualHost> block above, the
ServerAlias directive indicates that the listed names are other names
which people can use to see that same web site:
ServerAlias domain.tld *.domain.tld
then requests for all hosts in the domain.tld domain will be served by
the www.domain.tld virtual host. The wildcard characters * and ? can be
used to match names."
Jon
> _______________________________________________
> talk mailing list
> talk at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
More information about the talk
mailing list