Actions

Difference between revisions of "Redirect http to https"

From Lunarpages Web Hosting Wiki

m
 
Line 6: Line 6:
 
  #Options +FollowSymlinks
 
  #Options +FollowSymlinks
 
  RewriteCond %{SERVER_PORT} ^80$
 
  RewriteCond %{SERVER_PORT} ^80$
  <nowiki>RewriteRule ^(.*) https://yourdomain.com/cart/$1 [R,L]</nowiki>
+
  <nowiki>RewriteRule ^(.*) https://yourdomain.com/$1 [R,L]</nowiki>
  
 
''Replace yourdomain.com with your primary domain name.''
 
''Replace yourdomain.com with your primary domain name.''

Latest revision as of 20:30, 27 December 2019

Q: How can I redirect users from my http pages to the https pages?

A: You can do this by adding the following lines to your .htaccess file in /public_html/

RewriteEngine on
#Options +FollowSymlinks
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*) https://yourdomain.com/$1 [R,L]

Replace yourdomain.com with your primary domain name.

Please note: This will redirect all pages in your site to https. Most shopping carts can use http for viewing and will default to https on the page where a customer enters their credit card information.