You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Remo Mattei <re...@italy1.com> on 2003/09/22 03:18:58 UTC

[users@httpd] redirect all www to domain name

Hello guys what would be the right syntax to redirect all traffic
from a domain name starting with www.domain.com to domain.com, I
just get a warning in my ssl cert otherwise and this will fix it.

Thanks,

REMO



---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] redirect all www to domain name

Posted by Robert Andersson <ro...@profundis.nu>.
Remo Mattei wrote:
> Well, I must be dum... but I can't see it make the rule. the site
> for www.domain.com and domain.com are on the same dir. any other
> suggestions are welcomed.
>
> here is what I have now:
>
> RedirectMatch ^/www.(.*) https://domain.com/

Hmm, do you mean that you want to redirect http:// or https://?

If the former, I'd suggest the easy path:

<VirtualHost *>
    ServerName www.domain.com
    # you may, or may not, want this
    ServerAlias *.domain.com
    Redirect / https://domain.com/
</VirtualHost>

If the latter, it is more problematic as the SSL session must be established
before you can do anything, and you will thus have the warning anyway
(although I'm not sure why you'd get it; a cert for domain.com should work
fine for www.domain.com, right?). Solution: don't link to
https://www.domain.com/.

Regards,
Robert Andersson



---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] redirect all www to domain name

Posted by Remo Mattei <re...@italy1.com>.
Well, I must be dum... but I can't see it make the rule. the site
for www.domain.com and domain.com are on the same dir. any other
suggestions are welcomed.

here is what I have now:

RedirectMatch ^/www.(.*) https://domain.com/
Thanks,

Remo


> If you are using mod_vhost_alias, if your site is hosted in
> /home/httpd/domain.com, you could just make a symlink, like this:
> cd /home/httpd
> ln -s domain.com www.domain.com
>
> On Sun, 2003-09-21 at 18:55, SAQIB wrote:
>> Hello
>>
>> Take a look at first few examples @
>> http://httpd.apache.org/docs-2.0/misc/rewriteguide.html
>>
>> Saqib Ali
>> ---------
>> http://www.xml-dev.com
>>
>> On Sun, 21 Sep 2003, Remo Mattei wrote:
>>
>> > Hello guys what would be the right syntax to redirect all
>> traffic from a domain name starting with www.domain.com to
>> domain.com, I just get a warning in my ssl cert otherwise and
>> this will fix it.
>> >
>> > Thanks,
>> >
>> > REMO
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> 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: users-unsubscribe@httpd.apache.org
>> >    "   from the digest:
>> users-digest-unsubscribe@httpd.apache.org
>> > For additional commands, e-mail: users-help@httpd.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> 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: users-unsubscribe@httpd.apache.org
>>    "   from the digest:
>> users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> 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: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] redirect all www to domain name

Posted by Jess Mahan <je...@digitalssg.net>.
If you are using mod_vhost_alias, if your site is hosted in
/home/httpd/domain.com, you could just make a symlink, like this:
cd /home/httpd
ln -s domain.com www.domain.com

On Sun, 2003-09-21 at 18:55, SAQIB wrote:
> Hello
> 
> Take a look at first few examples @
> http://httpd.apache.org/docs-2.0/misc/rewriteguide.html
> 
> Saqib Ali
> ---------
> http://www.xml-dev.com
> 
> On Sun, 21 Sep 2003, Remo Mattei wrote:
> 
> > Hello guys what would be the right syntax to redirect all traffic
> > from a domain name starting with www.domain.com to domain.com, I
> > just get a warning in my ssl cert otherwise and this will fix it.
> >
> > Thanks,
> >
> > REMO
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> 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: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 



---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] redirect all www to domain name

Posted by SAQIB <sa...@seagate.com>.
Hello

Take a look at first few examples @
http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

Saqib Ali
---------
http://www.xml-dev.com

On Sun, 21 Sep 2003, Remo Mattei wrote:

> Hello guys what would be the right syntax to redirect all traffic
> from a domain name starting with www.domain.com to domain.com, I
> just get a warning in my ssl cert otherwise and this will fix it.
>
> Thanks,
>
> REMO
>
>
>
> ---------------------------------------------------------------------
> 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: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org