Solved

HHTP and HTTPS redirect question

Posted on 2016-09-28
3
58 Views
Last Modified: 2016-09-30
My site has been using HTTP for most of our product links.  We will send out emails to our customers about a special and point the link in the email to the product link on our website.  I have recently changed our site to use HTTPS for more security.  However the old links that use HTTP are now redirecting back to the home page and I'm not sure how to make the system find the product page using HTTP or HTTPS?
Our site is built using a magento platform, so i can use the magneto admin feature to point to HTTP or HTTPS and or I can change the HTACCESS file, I tried both and it seems that any old link just keep defaulting back to our home page, I believe that is coming from the HTACCESS file.
Any advice or suggestion would be help full.
0
Comment
Question by:Scott Johnston
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
Dr. Klahn earned 500 total points
ID: 41820390
I don't know diddly about Magento, but it looks to me like it sits on top of Apache or nginx.

That being the case, if your system is using Apache ...

Activate mod_rewrite and inspect the URL to rewrite "http://" to "https://" and then let it pass through into any other mod_rewrite rules you may have.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/%$1 [R,L]

Open in new window


This should be the first rule in any sequence of mod_rewrite rules.

Here's an article that shows a couple of ways to do it.  Note that the article author specified [R,L] in the RewriteRule.  I had to look that over carefully, and came to the conclusion that since this rule forces an external redirect the [L] is OK and the rewritten URL will be reprocessed through any possible following mod_rewrite rules when the redirect returns to the server.
0
 

Author Comment

by:Scott Johnston
ID: 41824235
after alot of research, THE htaccess file could conflict with the Magento web secure setting.  When using magneto, under the configuration, web setting there are options in which you can set the uses for http and or https.  If you set it to use secure and unsecure to use  HTTPS  you could then lose the connectivity to older URL that did not use HTTPS.
 ahh, but there is still another setting in Magento that will not reroute back using the  htaccess data.
The setting will use the HTACCESS if a link receive a 302 error  or 301 error, by turing this setting off it allow old link not to redirect back to the Base URL when receiving these browsing errors.

The setting is URL option, Auto-redirect to Base URL.
0
 

Author Comment

by:Scott Johnston
ID: 41824238
When using a megento site you need to have multiple configuration setting set correctly other wide a web link that is older may end up not being found and then it could re-direct back to the Base Url which is programmed in the HTACCESS file.

Thank you
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now