I will share 2 ways to achieve this:
- Using mod_rewrite. Add these directives to your configuration file:
- Using Redirect. Add these directives to your configuration file:
SSLRequireSSL
Redirect permanent /secure https://www.domain.com/secure
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
References:
Joseph Scott’s Blog
KarKomaOnline
Very nice thanks!
There is more examples at Apache SSL in htaccess examples in case different situation pops up! 🙂
I add this code in last of the htaccess file.URL chnage to https,but files are not opened.Please send reply as early as possible
Cool, I was wondering about this. Thanks for posting.
The second way (Redirect permanent) would be faster as mod_rewrite is not started and no regexes are checked?
Finally i found somthing that works!
This is extremely exciting, You are an excessively qualified tumblr. We have registered the feed and turn into in place to get inside search of extra of the superb submit. Furthermore, I’ve provided your web site during my myspace
I’m very pleased to discover this website.
I want to to thank you for your time just for this fantastic read!!
I definitely enjoyed every bit of it and i also have
you book-marked to check out new stuff in your blog.