Question
How to redirect http to https including www using .htaccess
for ex. http://forum9.com -> https://www.forum9.com
http://www.forum9.com -> https://www.forum9.com

Answers

RewriteCond %{HTTPS} off

RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} !^www. [NC]

RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


include these 4 lines in your .htaccess file for redirecting urls from http to https including www   Your Comment

wow, working like a gem, thanks






Search
Can you Answer!!
  • Q How do you configure electronic bank statement?
  • Q Explain what are prefix dereferencer and list them out?
  • Q Which, ancient' Indian King claimed ekarat (the sole sovereign) or the first Imperial ruler of India?
  • Q In which year Rash Bihari Bose organised the Indian Independence League at Bangkok?
  • Q How to create and run testng.xml?
  • Q Does advertisement layout start with visualization? What are the elements of ad layout? What should be the main principles of print media ad layout for a Polio Eradication Campaign?
  • Q Which is the oldest atomic power station?
  • Q What is the northernmost permanently inhabited place in Canada?
  • Q Objects are passed by value or by reference?
  • Q Fried Chicken Strawberry Shortcake trad Xmas eve meal where
  • Q Where can you see the number of accounts that this customer has?