Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

internal #link question

         

mcavill

6:45 am on May 18, 2017 (gmt 0)

10+ Year Member



Hello WebmasterWorld, I'm a long time member that's been away from web dev for some time but getting back into it all.

I have a quick question about some content I'm creating, regarding internal page anchors.

Its a wordpress site that's configured to write the URLs as www.domain.com/article-title/ (notice the last "/" )

So when I create internal page anchors (if that's even the right term!) I end up with a URL that looks like: www.domain.com/article-title/#section

I think the URL should ideally be: www.domain.com/article-title#section (no "/" before the "#section") - but to do so will mean messing around with my settings for the rest of the site....which I'd prefer to avoid.

If I leave it, will that last "/" cause me a problem with Google thinking it's another page...and then run into duplicate content issues

....or does google just ignore the "#section" part of the URL anyway and index www.domain.com/article-title/

Hope that makes sense!

phranque

10:09 am on May 18, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



internal page anchors (if that's even the right term!)

the proper technical term is now "document fragment identifier"

If I leave it, will that last "/" cause me a problem with Google thinking it's another page...and then run into duplicate content issues

....or does google just ignore the "#section" part of the URL anyway and index www.domain.com/article-title/

google will only index the document url, ignoring everything after hash mark.

the www.example.com/article-title/ url would appear to a user agent as a path to a directory and would expect a directory listing or more likely the default directory index document for that directory. (e.g. index.html/php/etc would be served internally)
since this is a WP site, the directory path request is being internally rewritten to the wordpress script, typically /index.php

goodroi

1:06 pm on May 18, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I refer to them as internal page anchors but I'm not proper :) Either way is going to be fine with Google because IMHO it is not a big deal. You can debate the fine details of this but there are bigger issues to worry about. You really need to focus on your page speed and mobile delivery. Those are much more important.

phranque

1:18 pm on May 18, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



will that last "/" cause me a problem with Google thinking it's another page.

i forgot to answer this specific question.
Either way is going to be fine with Google because IMHO it is not a big deal.

i agree - the trailing slash or not doesn't really matter but the fact changing most of the urls (to a non-slash in this case) could have some detrimental effects.
i wouldn't change it unless you had a good reason.

mcavill

1:47 pm on May 18, 2017 (gmt 0)

10+ Year Member



perfect - thanks very much both of you.

I moved hosts a few months ago and did some optimisation for page speed, and it's a responsive theme that works fine on mobile so fingers crossed all those items are reasonably good....there's more I could do for page speed though, so probably need to spend some time focused on that.

I'll leave my permalink structure as is. I didn't want to mess around with that given that google has indexed most of the site already, but also didn't want the "document fragment identifiers" ;) causing me any duplicate content challenges - thanks for your responses.