Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 General
 Suggestions - NOT QUESTIONS
 HTTPS Prioritization
Author « Topic »  

Graham Slaughter
Ecommerce Template Expert

821 Posts

Posted - 05/31/2018 :  16:15:46  
Hey Vince,

I recently moved one of our websites to HTTPS centric.

The technical process of this was very simple by adding this code to the web.config file:

<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>


I, however, had to fight for a LONG time to sort out why our proddetail pages were 301 chaining 2 redirects together. As I'm sure you know, a single 301 redirect is ideal for SEO purposes. 2 is not.

As it turns out, the getfullurl function in incfunctions.asp was thoughtfully choosing between http and https
getfullurl="http"&IIfVs(request.servervariables("HTTPS")="on","s")&"://"&request.servervariables("HTTP_HOST")


Unfortunately, that means that when a user requested a non https querystring'd proddetail.asp page - I got 1 redirect to the http SEO friendly URL version and that was followed up by a second redirect to the https version.

Example:
http://www.prothanesuspensionparts.com/proddetail.asp?prod=8304
--->
http://www.prothanesuspensionparts.com/8304
--->
https://www.prothanesuspensionparts.com/8304

In order to fix this, I had to change the code:
getfullurl="https://"&request.servervariables("HTTP_HOST")


and update my web.config to ignore proddetail pages:

<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{URL}" pattern="proddetail" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>



I wonder if it might be a good idea to incorporate sitewide HTTPS options so that things like this would instead force HTTPS regardless of which querystring was originally requested.

We already know that Google is giving a small rankings bump to HTTPS sites!

Further, in moving the site to HTTPS centric I had to update all the images and content to find any "http:" and replace with "https:" - it wouldn't be hard to create a tool to accomplish this with a single click and perhaps even as an add on tool that would allow for people to run the tool regularly in the future just incase something got coded in http by accident going forward.

- Graham Slaughter

Edited by - Graham Slaughter on 05/31/2018 16:16:18

Vince
Administrator

42753 Posts

Posted - 06/01/2018 :  01:29:34  
Hi Graham
How about if I change the code so that if the Store URL is set to an HTTPS location, then HTTPS is used in the "getfullurl" function? I think that will solve this for you.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Graham Slaughter
Ecommerce Template Expert

821 Posts

Posted - 06/01/2018 :  04:46:49  
Yes! We used the "fullBaseURL" variable for this with positive results elsewhere in the template. Having this code use that as well would probably make sense.

- Graham Slaughter
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000