Disturbed One Posted April 6, 2008 Share Posted April 6, 2008 Hello, I need to protect a subfolder and force https://www. so the SSL certificate will show as valid. When I try this code (placed in the subfolder that needs https), it works only if the domain is like this: https://www.mydomain.com/secure_folder/ (proper URL) http://www.mydomain.com/secure_folder/ (forces https) http://mydomain.com/secure_folder/ (forces both https and www) but does not work if the user types this: https://mydomain.com/secure_folder/ (fails to force the www) Here is what I am using: Options +FollowSymLinks RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} secure_folder RewriteRule ^(.*)$ https://www.mydomain.com/secure_folder/$1 [R,L] How can I force the https and www for all occasions? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/99853-force-https-and-www/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.