Welcome to WebmasterWorld Guest from 50.16.112.199

Double forward slash - a canonical concern?

   
6:34 pm on Aug 1, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



I'm trying to fix an issue where pages of my site open with either correct

www.example.com/example.htm

or incorrect double forward slash in the beginning of the file path:

www.example.com//example.htm

Oddly enough, the second form is how GA sends me to my own pages from its reports. I can't figure out if it's a GA issue or something's terribly wrong with how Googlebot browses my site.

Anyhow, the site has a rather complicated .htaccess file and I've yet to find a rule that would satisfy all the other existing rules but successfully removed that extra forward slash. While working on it, I got to wonder if that even matters. It looked to me that the way this always happens with GA reports, perhaps Google takes a relaxed view on that extra slash that does not change anything. Perhaps they even delete it themselves before indexing, I'm not sure.

Does anyone see an issue with leaving that extra forward slash untouched and letting pages open on both versions of URL?
7:23 pm on Aug 1, 2013 (gmt 0)

WebmasterWorld Senior Member Top Contributors Of The Month



Personally, I'd fix them. Even if they're not an issue right now with how Google handles your site and rankings who knows about tomorrow or other search engines?

It would suck to leave them the way they are and wake up one day to find they're causing a ranking issue and have traffic drop while your waiting for the fix to make it through the system.

* If you can't get the .htaccess working rel=canonical to the non-double slash location should cover it with the major SEs at least.
11:04 pm on Aug 1, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Thanks, JD. I already have rel=canonical on all content pages, so perhaps that's not such a big deal. I would still think it affects my crawling budget because bots need to read the same page twice, so I'm planning to get to the bottom of this eventually.
11:10 pm on Aug 1, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



RewriteRule ^/+(.*) http://www.example.com/$1 [R=301,L]

:)
11:15 pm on Aug 1, 2013 (gmt 0)

WebmasterWorld Senior Member Top Contributors Of The Month



NP. One thing I thought of later is if your site is PHP driven it would be fairly easy to drop the redirect on the page(s) if one is requested with a // and totally bypass the .htaccess. (This is how I would do it if the .htaccess was giving me too much of a headache lol)

if(strpos($_SERVER['REQUEST_URI'],'//')!==FALSE) {
$redirect_to=str_replace('//','/',$_SERVER['REQUEST_URI']);
header('Location: http://www.example.com'.$redirect_to,TRUE,301);
}
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month