I’m using a php book to build a ecommerce site. It gives instructions to rewrite the htaccess file so that the site uses an SSL connection on certain pages. This is the code it gives.
RewriteCond %{HTTPS} off
RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1 [R=301,L]
The problem is that I’m using a shared server with a shared SSL certificate. So my url
https://.example.com/checkout.php
actually needs to be
https://example.c8.hostexcellence.com/checkout.php
but I can’t figure out how to incorporate the .c8.hostexcellence into the rewrite so that it connects via SSL
Note, I tried the both of the following but they didn’t work.
RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://example.c8.hostexcellence.com/$1 [R=301,L]
RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{example.c8.hostexcellence.com}/$1 [R=301,L]
UPDATE
This is how it’s supposed to be accessed with an SSL connection. I need to change my htaccess file so the links are established this way.
https://titanicraisins.c8.hostexcellence.com/checkout.php?session=72cac503b52a73308af0508fe462090a
This is my current htaccess file
AddHandler phpini-cgi .php .htm
Action phpini-cgi /cgi-bin/php5-custom-ini.cgi
<IfModule mod_rewrite.c>
RewriteEngine on
# For sales:
RewriteRule ^shop/sales/?$ sales.php
# For the primary categories:
RewriteRule ^shop/([A-Za-z\+]+)/?$ shop.php?type=$1
# For specific products:
RewriteRule ^browse/([A-Za-z\+\-]+)/([A-Za-z\+\-]+)/([0-9]+)$ browse.php?type=$1&category=$2&id=$3
# For HTTPS pages:
RewriteCond %{HTTPS} off
RewriteRule ^(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
Remove
%{...}around and just specify domain name