302 redirects behind SSL reverse proxy
302 redirects behind SSL reverse proxy Problem You have a web server running plain http behind an Apache reverse proxy running https. Your application uses 302 redirects to announce new URLs or whatever the reason is for doing so. The client will be redirected a plain http url. Solution You can create a Vhost listenig for plain http and all that it does is redirect the clients to https, like this: NameVirtualHost *:80 <VirtualHost *:80> ServerName www.example.com Redirect permanent / https://secure.example.com/ </VirtualHost> This way, the client is redirected to the plain http by the proxied server and then redirected back to https by the proxy server. Another solution is to use mod_rewrite: RewriteEngine On # This will enable the Rewrite capabilities RewriteCond %{HTTPS} !=on # This checks to make sure the connection is not already HTTPS RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] # This rule will redirect users from their original locatio...