Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Google indexing https version of pages

Trying to redirect them, but I keep getting errors

         

Universityzeus

2:19 pm on Dec 23, 2006 (gmt 0)

10+ Year Member



Some of our root pages are showing up with duplicate entries for https. I've been trying to 301 redirect https using isapi-rewrite (I'm on IIS). However, the following code doesn't seem to work at all.

RewriteCond %SERVER_PORT ^443$
RewriteCond Host: ^www\.sitename\.com
RewriteRule (.*) http\://www\.sitename\.com/$1 [RP,L]

My testing in Firefox yields a crazy error (Error: -12263!), and IE just returns an invalid page.

From all of my research, this code is correct. Has anyone ever seen this issue?

I know that we should move them to a subdomain, but that will probably take a little while to take care of (cert modifications, file moving, server changes). In the meantime though this would seem to be the least intrusive correction I can come up with.

WW_Watcher

3:48 pm on Dec 23, 2006 (gmt 0)

10+ Year Member



Hey Universityzeus,

I have/had the same issue, I hate to tell others when I do not know for sure if this method has corrected this issue for me. I enacted the following a couple of weeks ago, and IMHO there has not been enough time passed to see if it worked, or if I totally messed up the spidering of my site.

Running on apache:

I created a text file named robots_ssl.txt containing

User-agent: *
Disallow: /

I added the following to my .htaccess to use this file to re-write the robots text file with the blocking instructions only when the request met the condition of having come thru port 443.

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

I already had in the

Options +FollowSymLinks -MultiViews
RewriteEngine on

for my other re-write conditions & rules

Use this at your own risk! It appears to work great, but I have not had it out there long enough to tell yet, the jury is still out.

Back to Watching
WW_Watcher

Edited to add:
I did not try redirecting the url to a non https for fear of breaking the ssl & I kinda like the thought of users being able to surf my site totally with http, or https, with no problems either way, provided it is working the way I think it is.

[edited by: WW_Watcher at 3:55 pm (utc) on Dec. 23, 2006]

Universityzeus

12:22 am on Dec 24, 2006 (gmt 0)

10+ Year Member



Wow, that is an interesting workaround. I would be very scared to try that using isapi-rewrite in IIS without verifying that, but thanks for opening another door for me.

theBear

1:04 am on Dec 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think you need to escape the right hand side of a rewrite rule.

I am not certain that your ruleset is correct even after correcting the escaping issues. It looks like you just rewrite other than port 443 and then only if the host is not the www subdomain.

I have no current means to test a port 443 system.

Pirates

2:08 am on Dec 24, 2006 (gmt 0)



Just add it as a deny in robots .txt on main site "https....." and add robots.txt deny all on https. Remember google follows these rules, it would be a rogue crawler you would deal with in htaccess. Not neccessary here.