Solved

HHTP and HTTPS redirect question

Posted on 2016-09-28
3
97 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 24

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 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

26 Experts available now in Live!

Get 1:1 Help Now