Hi list,
I've been playing around with a .htaccess file and mod_rewrite, but I can't
get it to do what i want. Which is..
[1] http://host redirects to https://host.fqdn.com
[2] https://host redirects to https://host.fqdn.com
The reason I'm trying to do this is that firefox 3 gives an error page now
instead of the certificate warning of firefox 1 or 2, when not accessing
the server by the fqdn. So I'd like to fix this using rewrite rules on the
server before rolling out firefox 3. The firefox 3 error page says:
Secure Connection Failed
'host' uses an invalid security certificate.
The certificate is not valid for any server names.
(Error code: ssl_error_bad_cert_domain)
My .htaccess contains
RewriteEngine On
RewriteCond %{HTTP_HOST} !host.fqdn.com
RewriteRule ^(.*) https://host.fqdn.com%{REQUEST_URI} [R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://host.fqdn.com%{REQUEST_URI} [R=301,L]
which works for [1] but not for [2]. Is it possible to get the second case
to work?
Marcus.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!