03-06-07 12:17 AM
I manage a web site which over the years has picked up a lot
of DNS alias names. I'm trying to send 301 redirects to any client
that uses one of the older names. This web server uses both
ports 80 and 443. This redirect does exactly what I want for
port 80, but nothing happens for port 443, whatever the original
(alias) name used was, that stays in the browser and there is
no redirect. This is I believe the relevant part of the httpd.conf
file:
ServerName theserver.theschool.edu
UseCanonicalName On
RewriteEngine on
RewriteCond %{HTTPS} !=off
RewriteCond %{HTTP_HOST} !^theserver\.theschool\.edu [NC]
RewriteRule ^(.*) https://theserver.theschool.edu$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^theserver\.theschool\.edu [NC]
RewriteRule ^(.*) http://theserver.theschool.edu$1 [R=301,L]
(Note it uses "theserver.theschool.edu$1" instead of
"theserver.theschool.edu/$1", as in every example I found on the net,
because the latter form always puts two slashes after the
server's name in the URL.)
Apache 2.054 server running on Solaris 8, tested with Seamonkey.
Thanks,
David Mathog
[ Post a follow-up to this message ]
|