eCommerce construction > How-to questions

how to redirect http and www to https


Can anyone tell me how can I how to redirect http and www to https. I want to make sure when 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

Your need to rename the .txt file to .htaccess

You can try something like this example

--- Code: ---# SEO URL Settings
RewriteBase /
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 ---

Yep that did the trick, thak you.


[0] Message Index

Go to full version
Powered by SMFPacks Social Login Mod