Solved

HHTP and HTTPS redirect question

Posted on 2016-09-28
3
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 28

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

This article discusses four methods for overlaying images in a container on a web page
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

624 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