News:

AbanteCart v1.4.2 is released.

Main Menu

how to redirect http and www to https

Started by Baychaser, April 06, 2023, 09:53:54 PM

Previous topic - Next topic

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
# 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


https://stackoverflow.com/a/28831015

Baychaser


Forum Rules Code of conduct
AbanteCart.com 2010 -