Http To Https Redirection Not Working Properly

Recently we moved our website from http to https most of the pages are working but some of the pages are not redirecting properly

The .htaccess has the code below:

RewriteEngine on        

RewriteBase /
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

The product when accessed directly through this link works and opens:

https://www.fleaffair.com/spargz-spiritual-laxmi-necklace-set-suspended-with-cluster-of-pearl-ains-100.html

But if use http instead it goes to the home page instead.

http://www.fleaffair.com/spargz-spiritual-laxmi-necklace-set-suspended-with-cluster-of-pearl-ains-100.html

Most of the other products are redirecting properly. Our worry is the backlinks we have for this product in google and other places which will cause the link to break.

Also how will we generate the sitemap with https:// links

What version of cs-cart are your running?

The more recent versions don't require any change to .htaccess in that they will handle the redirection internally if the storefront settings are either full site, checkout/profie, etc. and/or the secure admin checkbox is set. These are available from the Settings/Security menu.

Both of your links generate a 404 from here.

What version of cs-cart are your running?

The more recent versions don't require any change to .htaccess in that they will handle the redirection internally if the storefront settings are either full site, checkout/profie, etc. and/or the secure admin checkbox is set. These are available from the Settings/Security menu.

Both of your links generate a 404 from here.

The version is MVE 4.2.4. Both the links are opening.

Both open!

Fixed it by clearing the cache on the server and restarting apache

Fixed it by clearing the cache on the server and restarting apache

Did you apply the default htaccess file as well? Reason I ask is because the following 2 lines shouldn't be in it.

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

changed these lines to

RewriteCond %{HTTP_HOST} ^fleaffair\.com
RewriteRule (.*) https://www.fleaffair.com/$1 [R=301,L]