eCommerce construction > How-to questions

how to redirect http and www to https

(1/1)

Baychaser:
Can anyone tell me how can I how to redirect http and www to https. I want to make sure when bargainlanes.com is typed to redirect to https. I did a store setup with correct https info and this is what I have in my "htaccess.txt" file and it's still not working, is it supposed to end with ".txt" or do I have to change it to "htaccess" only

It works normally when I click any link on site and it Will switch back to https

Basara:
Hello.
Your need to rename the .txt file to .htaccess

You can try something like this example

--- Code: ---# SEO URL Settings
RewriteBase /
#http-https
RewriteCond %{HTTPS} !on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#www force
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#all other rules below
--- End code ---

https://stackoverflow.com/a/28831015

Baychaser:
Yep that did the trick, thak you.

Navigation

[0] Message Index

Go to full version
Powered by SMFPacks Social Login Mod