httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthijs Rohs" <matth...@rohs.nl>
Subject RE: Redirecting URLS...
Date Thu, 15 Aug 2002 13:18:57 GMT
I know that vhosting needs to be done into httpd.conf
So it is absolutely not possible to redirect http://www.rohs.nl/ to
http://rohs.nl/ with .htaccess?

ViVa

-----Oorspronkelijk bericht-----
Van: Boyle Owen [mailto:Owen.Boyle@swx.com] 
Verzonden: donderdag 15 augustus 2002 15:15
Aan: users@httpd.apache.org
Onderwerp: RE: Redirecting URLS...

I'm afraid I don't understand you. You can only "redirect" sites that
you host...

Do I understand correctly that you want http:/www.rohs.nl,
http://rohs.nl and http://xxx.rohs.nl all to lead to the same site?

If so and if, as you say, all domain names point to the same IP address,
then it is easy. You just have the VH listen to the IP address and then
either list the sites with a ServerAlias directive (e.g.

ServerName www.rohs.nl
ServerAlias rohs.nl xxx.rohs.nl

or use a wildcard:

ServerName www.rohs.nl
ServerAlias *

N.B. This directive can only go in a VirtualHost - you can't use it in a
.htaccess file. Check the docs...
 
Rgds,
Owen Boyle

P.S. You can use mod_rewrite if you want (you'd have to make a VH for
each variant and then do a rewrite rule to switch into the primary
site). It is complete overkill when there is a perfectly good directive
which will do what you want.

>-----Original Message-----
>From: Matthijs Rohs [mailto:matthijs@rohs.nl]
>Sent: Donnerstag, 15. August 2002 14:50
>To: users@httpd.apache.org
>Subject: RE: Redirecting URLS...
>
>
>Well I'm not hosting rohs.nl at my own server, but rohs.nl and
>www.rohs.nl and xxx.rohs.nl do all point to the same IP address.
>So I would like to know the line to put into .htaccess and not the line
>for httpd.conf. *.rohs.nl points to 213.196.37.149
>Do you know the line for .htaccess ? maybe it's mod_rewrite ?
>
>ViVa
>
>-----Oorspronkelijk bericht-----
>Van: Boyle Owen [mailto:Owen.Boyle@swx.com] 
>Verzonden: donderdag 15 augustus 2002 14:42
>Aan: users@httpd.apache.org; matthijs@rohs.nl
>Onderwerp: RE: Redirecting URLS...
>
>> From: Matthijs Rohs [mailto:matthijs@rohs.nl]
>
>> Does anyone know how I can redirect http://www.rohs.nl/ to
>http://rohs.nl/ ?
>
>It depends:
>
>(1) If both domain names resolve to the same IP address, then just make
>one a server alias, e.g.
>
><VirtualHost 192.168.0.1>
>  ServerName www.rohs.nl
>  ServerAlias rohs.nl
> ...
>
>(2) If the have different IP addresses, put both addresses in 
>the VH tag
>as well
>
><VirtualHost 192.168.0.1 192.168.0.2>
>  ServerName www.rohs.nl
>  ServerAlias rohs.nl
> ...
>
>I am assuming that you realise that this has more to do with DNS than
>with apache.
>
>Rgds,
>
>Owen Boyle
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message