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 >>
Powered by
Powered by Novacaster