You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matthew England <me...@mengland.net> on 2004/10/11 06:02:01 UTC

[users@httpd] Redirection http: to https: & truncating "www." prefix

Hello,

I am attempting to redirect all http (port 80) access to my server to https 
(SSL on port 443).  I've added this to my httpd.conf and it seems to 
work.  Can this group verify this will be correct for all my 
situations/scenarios?

<VirtualHost *:443>
     ServerName example.com
</VirtualHost>

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
Redirect permanent / https://example.com/
</VirtualHost>


I also want to truncate the "www." prefix on the https access (as I think I 
have done in the http access) with the following, additional lines:

<VirtualHost *:443>
     ServerName www.example.com
     Redirect permanent / https://example.com/
</VirtualHost>

However, this does not appear to work.  Any pointers/recommendations?

My apologies if this is a faq.

-Matt


---------------------------------------------------------------------
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