Re: [users@httpd] Redirect conditional on SSL/non-SSL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Brian,

A very simple solution that works on any type of webserver is to replace the standard 403.4 "SSL Required" error document with some sort of automatic redirect code. In apache.conf
you would put e.g.

 ErrorDocument 403 /error/ssl_auto_redirect.php

In "ssl_auto_redirect.php" you determine the requested resource with getenv('REQUEST_URI') and what else might be needed, slash "https://"; in front and do a location('<url_with_https_in_front>');

Very simple and it works. Haven't done it in apache yet, but used to do it in IIS. Happy coding!

Mads Rosendahl


Brian Candler wrote:

I would like users to be able to put an incantation in their .htaccess files
which says: "if this directory was not accessed via SSL, then issue a
redirect to https://....";

I know about SSLRequireSSL, but that just rejects the request.

Is there a way to do this short of using mod_rewrite? I am using Apache 1.3
and mod_ssl.

Thanks,

Brian.

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



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



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux