Forzar que Apache sirva siempre determinadas paginas web mediante https
Thursday, February 11, 2010 14:47Posted in category Administrador Sistemas
No Comments
Si necesitamos configurar nuestro servidor web Apache para que sirva siempre determinadas páginas bajo el protocolo HTTPS aquí os dejo el siguiente tip:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) http://www.dominio.com$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/pagina1.jsp [OR]
RewriteCond %{REQUEST_URI} ^/pagina2.jsp [OR]
RewriteCond %{REQUEST_URI} ^/pagina3.jsp [OR]
RewriteCond %{REQUEST_URI} ^/pagina4.jsp [OR]
RewriteCond %{REQUEST_URI} ^/pagina5.jsp
RewriteRule .* - [E=needhttps:on]
RewriteCond %{ENV:needhttps} =on
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} =on
RewriteCond %{ENV:needhttps} !=on
RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Espero que os sea de utilidad
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.