Our website would like to use cookies to store information on your computer. You may delete and block all cookies from this site, but parts of the site will not work as a result. Find out more about how we use cookies.

Login or Register

Powered by
Powered by Novacaster
 
Re: Trivial, I thought.
by Simon at 12:51 26/08/05 (Forum::Technical Advice::General)
You want a conditional rewrite rule in your webserver config - one that can check if the request came in via SSL (port 443), and redirect if and only if it didn't.

In Apache-speak, something like:

RewriteEngine on
RewriteRule ^/(app.*)$ https://www.site.com/$1

in the non-secure virtual host config ought to do the trick. Assuming you have separate vhost configs for the secure and insecure server, of course. If it's the same config for both, or you're using a global config and the same server's listening on both 80 and 443 then you need to add

RewriteCond %{SERVER_PORT} !=443

above the RewriteRule

Regards
--
simon

<< linux 'find' command mod_rewrite notes >>
View Comments (Flat Mode) Printer Version
Trivial, I thought. Bruce Ure - 26/08
    Re: Trivial, I thought. Simon - 26/08