Forum Moderators: phranque
I want to permit SSL only to [mydomain.com...] and block non-SSL to [mydomain.com...]
I've tried these in both http.conf and .htaccess but with no luck.
RewriteEngine On
RewriteCond %{REQUEST_METHOD} !^https
RewriteRule ^index.html$ [mydomain.com...] [R,L]
RewriteEngine On
RewriteRule ^/$ /index.html
RewriteCond %{SERVER_PORT}!443$
RewriteRule ^(.*) [mydomain:443$1...] [R=301,L]
Platform:
Win2K3 SP2
Apache 2.2
Tomcat 6 (with mod_jk)
RewriteEngine on
RewriteCond %{SERVER_PORT} !443$
RewriteRule ^/?(directory1/.*) https://www.example.com/$1 [R=301,L]
Flush your browser cache before testing. If you put the code in httpd.conf, then restart your server before testing. This code should work in htppd.conf or in example.com/.htaccess.
Jim
See also the documents cited in our forum charter, and the examples in threads in our forum library.
Jim