0

I am trying to force ssl on certain urls using the following .htaccess on apache FastCGI. But the problem is when I try to browse http://[hostname]/basket it redirects to http://[hostname]/index.php?/basket instead of https://[hostname]/basket. Below is the code. I am stuck with this please help

RewriteEngine on
RewriteBase /



RewriteCond %{HTTPS} off 
RewriteCond $1 (checkout|basket)
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTPS} on 
RewriteCond $1 !(checkout|basket)
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
dezignwise
  • 1
  • 1
  • 3

1 Answers1

0

This issue has been resolved: below is the code if anyone else having the same issue:

RewriteEngine on
RewriteBase /

RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 (checkout|basket)
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteCond %{HTTPS} on 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !(checkout|basket)
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
dezignwise
  • 1
  • 1
  • 3