homepage Welcome to WebmasterWorld Guest from 54.198.148.191
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
https 301 to http for Google
wheel




msg:3251359
 3:00 pm on Feb 13, 2007 (gmt 0)

I've got a twist on an old problem. I'm seeing both https and http results showing up in Google's site:domain.com command for a couple of domains.

These domains previously had ssl certs so I was using the https. The certs made no difference, so I dropped them.

What happens now is that (this is the way apache works) an https connection, when not found for that domain, automatically goes to the first https connection on the server. So when Google is indexing https://www.domain1.com, it's actually being served https://www.domain2.com. Domain2.com has an ssl cert that is being actively used.

What's the best way to clean up this mess? Typically a .htaccess on domain1.com would just 301 to the non https version, but in this case domain2.com is actually being served.

 

jdMorgan




msg:3251547
 5:54 pm on Feb 13, 2007 (gmt 0)

Sounds like you'll need to reinstate the virtual server for HTTPS, and then redirect its requests to HTTP...

Jim

sabai




msg:3251750
 9:20 pm on Feb 13, 2007 (gmt 0)

You can't do name based SSl on apache since it has to be bound to an interface... You can have virtual hosts setup on the same server, but only ever have one per interface on SSL. So yes, any requests to the virtual hosts on https will resolve to the same place.

I think in your case you might just want to do a conditional redirect with mod-rewrite to the http version of the site... since 301's should be absolute URLS, in theory there is no problem doing cross domain... don't know if google still has problems with cross-site 301's though - there used to be issues with the original URL being displayed.

pseudocode for mod-rewrite:

IF HTTPS
IF HTTP_DOMAIN
REDIRECT [HTTP_DOMAIN...] [R]

If you don't want to do 301's you could always just serve a 404 for those pages.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved