Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Redirection 1

Status
Not open for further replies.

Hondy

Technical User
Mar 3, 2003
864
GB
Hi

I believe that some search engines rank you badly for page redirection but what about redirecting to SSL?

I used the following Microsoft solution for forcing HTTP to HTTPS. But it seems to redirect, can anyone tell me if redirecting to SSL would negatively affect ranking if the home page is redirected to HTTPS?


Thanks
 
There may well be major SE "side effects" with the MS solution as it uses a plain "response.redirect". This will send a 302 response to the user agent. This is a temporary redirect so will not force an update of the indexed URIs.

The code should be changed to send a permanent redirect (301) to ensure that indexed URIs are updated and the originals dropped from the database.

Code:
<%
   If Request.ServerVariables("SERVER_PORT")=80 Then
      Dim strSecureURL
      strSecureURL = "[URL unfurl="true"]https://"[/URL]
      strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")
      strSecureURL = strSecureURL & Request.ServerVariables("URL")
      Response.Status = "301 Moved Permanently"
      response.addheader "Location", strSecureURL
   End If
%>


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Chris thanks for that, I'll put that in
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top