Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



SEO Class in Chicago, IL

Learn How To Optimize Your Website on July 26, 2013


Looking for personalized in-depth SEO training among your peers?



High Rankings is offering a 1-day customized SEO training class in Chicago. Class size is limited so please sign-up now if you want in!



 


Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

How Do I Redirect Https To Http On My Site?


  • Please log in to reply
9 replies to this topic

#1 chrisjum

chrisjum

    HR 3

  • Active Members
  • PipPipPip
  • 51 posts

Posted 23 May 2008 - 06:40 PM

Any page on my website can be viewed in https or http. I want to use a mod_rewrite in my .htaccess file to redirect any https to http on my site. Does anyone know the code for this so I can avoid having duplicate listings in the search engines or possibly bleed page rank.

#2 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 23 May 2008 - 08:36 PM

Assuming you've got a standard *nix-Apache configuration where https uses port 443...

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


#3 chrisjum

chrisjum

    HR 3

  • Active Members
  • PipPipPip
  • 51 posts

Posted 23 May 2008 - 11:25 PM

QUOTE(Randy @ May 23 2008, 08:36 PM) View Post
Assuming you've got a standard *nix-Apache configuration where https uses port 443...

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


I do indeed. That seems simple enough! Thanks a million!

#4 incrediblehelp

incrediblehelp

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 591 posts
  • Location:Kentucky

Posted 24 May 2008 - 12:14 AM

What if you are on IIS?

#5 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 24 May 2008 - 01:04 PM

QUOTE
What if you are on IIS?


Good luck! lol.gif

Seriously though, it can be done on IIS. I'll leave explaining exactly how to someone who works with IIS every day because there may be some differences between the different version with which I'm obviously not familiar. If you review Chris' Smart 404 code samples here on the forum you can use a similar snippet of code at the top of each page to perform the redirect from https to http. I believe the IIS server variable you'll be looking at as the trigger will be Request.ServerVariables("HTTPS")

#6 jehochman

jehochman

    Jonathan Hochman

  • Active Members
  • PipPipPipPipPipPipPip
  • 1,555 posts
  • Location:Connecticut - Land of Steady Habits

Posted 29 May 2008 - 08:20 AM

1. Install ISAPI rewrite.

2. Test this code:
CODE
# redirect all https requests to http
RewriteCond  %HTTPS (?!off).*
RewriteCond Host: (.*)
RewriteRule (.*) http\://$1$2 [I,RP]


3. Let us know if it works.

Edited by jehochman, 29 May 2008 - 08:28 AM.


#7 sddreamweavers

sddreamweavers

    HR 2

  • Active Members
  • PipPip
  • 30 posts

Posted 29 May 2008 - 04:27 PM

QUOTE(incrediblehelp @ May 23 2008, 10:14 PM) View Post
What if you are on IIS?


Google 'ISAPI Re-write'

It's a great tool that does just about everything that a .htaccess file does. Make sure your hosting company can install it before purchasing it.

#8 incrediblehelp

incrediblehelp

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 591 posts
  • Location:Kentucky

Posted 29 May 2008 - 04:55 PM

Yes I have heard of it, but some people cant get it installed at their hosts and some people say ISAPI is just to slow.

#9 seopractices

seopractices

    HR 1

  • Members
  • Pip
  • 3 posts

Posted 24 July 2008 - 08:36 AM

Hello Hihgranking members, I'm a returning member, used to hang around here a while ago, now I'm back as the good old son.

I have a related issue on my site, I have noticed that Google is displaying the home page and other pages of the site with the https protocol sometimes and others with http protocol it might be creating canonical issues.

I want to clear out that the home page does not have any forms to be filled out. I was told that this issue has something to do with server configuration.

How to handle this issue so just the pages with forms show as https and the rest of the Site as http? And not both ways as I see it is showing for the entire site.

Server info: pc server / intel xeon hardware with Redhat Linux as OS, dedicated hosting.

Some pages on the Site were set as https for security purposes, visitors come to these pages and leave personal information so they wanted to make sure the information on these pages are encrypted. The problem though is that for some reason, by setting these secure pages on the Site, all pages on the Site are also accessible via https protocol.

So on the Site there is an http version of each page and a https version of each page, that creates dup content in my opinion. I was told that had to with the way the server was set up.

What I want to know is how to set up https pages just for the ones that need to be secure and not do it for the entire site, as it is now on the site?

Thanks in advanced.


#10 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 24 July 2008 - 02:39 PM

Welcome back seopractices! hi.gif

What type of server are you on. Unix/Linux or IIS? And is it safe to assume there are only a few pages that need the https secure version, and the vast majority would be better off without https?

First you may want to take a look at how you're linking between your pages. If you're using referential links it's important to remember the browser or other user agent can easily get things confused. Both for http/https issues as well as www/non-www issues.

A quick and dirty stab in the dark just in case you're on a *nix server with mod_rewrite enabled and you only have a few of those form pages you need to exclude

CODE
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REQUEST_URI} !^/formpage1\.php [OR]
RewriteCond %{REQUEST_URI} !^/formpage2\.php
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]


You can use as many rewrite condition lines as necessary to exclude pages that need to be able to be secure. Just make sure to put an [OR] after each of these, excepting the last one.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users