Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

redirecting https to http


d4funky1

Recommended Posts

Hi,

 

I added some code to my .htaccess file to redirect all https files to the http version.

 

This worked fine at first glance however when i attempted to process a test order the order_info.php pages where the customer information if placed keeps looping.

 

When I take the code out again the order process works as normal?

 

Here is the code i added:

 

RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]

 

Can anyone offer a suggestion as to how we can resolve this.

 

Many Thanks

D4

Link to comment
Share on other sites

Hi,

 

I've managed to sort the problem.

 

what you will need to do is add a second robots.txt file in your root folder call it robots_ssl.txt

 

add this to the file:

 

User-agent: Googlebot
Disallow: / 

User-agent: * 
Disallow: /

 

Now add the following code to your .htacces file:

 

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} ^443$ 
RewriteRule ^robots.txt$ robots_ssl.txt

 

Please note that some of you may already have the top section due to seo url modules that are available so you will only need to add the following:

 

RewriteCond %{SERVER_PORT} ^443$ 
RewriteRule ^robots.txt$ robots_ssl.txt

 

You should now see a different robots file when you visit

 

http://www.yoursite.com/robots.txt

 

and

 

https://www.yoursite.com/robots.txt

 

That's it - although all your https files will remain untouched the code will use the new robots_ssl.txt file for all search engine bots when they attempt to visit a https page

 

Please note that this work around is for apache/linux only - sorry

 

I can't take any credit for this so please don't give any.

 

Thanks

D4

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...