LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] apache2 mod_rewrite

[ILUG] apache2 mod_rewrite

Marcus Furlong furlongm at hotmail.com
Fri Jun 20 15:41:55 IST 2008


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.




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell