Jump to content

Options for trailing slashes and SEO


Peter Knight
 Share

Recommended Posts

Had a question about trailing slashes and forcing one or other.

I've a site where most pages can be accessed with AND without a trailing slash

IE

domain.com/about-us/contact
and
domain.com/about-us/contact/

are both accessible and being indexed by Google. It's obviously bad for SEO but I can't seem to make PW respect one and redirect etc.

There is a setting in templates>template>URLs 

Quote

Should page URLs end with a slash
If 'Yes', pages using this template will always have URLs that end with a trailing slash '/'. And if the page is loaded from a URL without the slash, it will be redirected to it. If you select 'No', the non-slashed version will be enforced instead. Note that this setting does not enforce this behavior on URL segments or page numbers, only actual page URLs. If you don't have a preference, it is recommended that you leave this set to 'Yes'.

I must be overlooking something as I have 'yes' selected and both URLs are still reachable with no redirect.

What do you guys do to counter this?

 

Link to comment
Share on other sites

Hello @Peter Knight,

as long as you don't mix both versions in your internal links or XML sitemap, I don't think it is bad. ;)

Here is what Google writes to this topic:

Quote
  • Leave it as-is. Many sites have duplicate content. Our indexing process often handles this case for webmasters and users. While it’s not totally optimal behavior, it’s perfectly legitimate and a-okay. :)

Or could you please explain a little further or provide an link, why it would be "obviously bad"? I am no SEO expert, so that would interest me.

I have never changed the default setting for URLs and never experienced an downside from it. Also search engines maybe indexing both versions both show only the version with slash as results.

Regards, Andreas

Edit: I have missed, that your URLs do not redirect.

Edited by AndZyk
  • Like 1
Link to comment
Share on other sites

Just an FYI - I have that setting on (as is default), and if I link to a page without the trailing slash, it always redirects to the slash version. Any chance you have something that might be hijacking the redirect?

  • Like 1
Link to comment
Share on other sites

I always assumed duplicate content incurred a Google penalty and affected your rankings. Possibly this isn't as much a problem anymore as @AndZyk mentioned and Google gets better about handling it etc.

@adrian I have the usual batch of .htaccess settings, ProCache and and SEO Module. I couldn't narrow it down to any.

Link to comment
Share on other sites

https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html

quote:

You can do a quick check on your site to see if the URLs:

  1. http://<your-domain-here>/<some-directory-here>/
    (with trailing slash)
  2. http://<your-domain-here>/<some-directory-here>
    (no trailing slash)

don’t both return a 200 response code, but that one version redirects to the other.

  • If only one version can be returned (i.e., the other redirects to it), that’s great! This behavior is beneficial because it reduces duplicate content. In the particular case of redirects to trailing slash URLs, our search results will likely show the version of the URL with the 200 response code (most often the trailing slash URL) -- regardless of whether the redirect was a 301 or 302.
Link to comment
Share on other sites

On 08/08/2017 at 0:12 AM, AndZyk said:

Or could you please explain a little further or provide an link, why it would be "obviously bad"? I am no SEO expert, so that would interest me.

The post you linked to actually mentions two reasons why this might be bad: it could be identified as duplicate content and it could have a negative effect on crawl efficiency. Neither is something you should really worry about in this case, but then again: Google is a black box (it's impossible to say for sure how their algorithm works), that article is from 2010 (things have changed a lot since then), and some SEO experts do seem to love their micro-optimisations :)

Although in that article they go on to say that their indexing process "often" automatically detects and corrects this issue, it is also true that this is one of those things that are so easy to fix that, even for a tiny theoretical chance that it could affect your rankings, you should stick with one URL format.

On 08/08/2017 at 9:38 AM, Peter Knight said:

I always assumed duplicate content incurred a Google penalty and affected your rankings. Possibly this isn't as much a problem anymore as @AndZyk mentioned and Google gets better about handling it etc.

According to various sources there's no penalty for duplicate content, especially not in cases like this. It would seem that the only way you can get penalised is if Google thinks you're trying to deceive them somehow with said duplicate content. I highly doubt that the trailing slash issue would count.

  • Like 3
Link to comment
Share on other sites

On 8/8/2017 at 0:16 PM, teppo said:

some SEO experts do seem to love their micro-optimisations

That's the whole thing in a nutshell. Don't sweat the tiny details

FWIW I don't think of the 'duplicate content penalty' as a penalty per se, more a discounting of the value of any content that is identified as a duplicate of some other content that is counted. If there is a negative, it's that it costs your crawl budget. By which I mean that say Google is prepared to crawl 10 pages of your site per visit, if 2 of those pages are the same content under very slightly different URLs, you are blowing the opportunity to have another actual different page crawled.

Having said that, and getting back to the point, there are any number of more significant things to be spending time on.

  • Like 1
Link to comment
Share on other sites

43 minutes ago, DaveP said:

FWIW I don't think of the 'duplicate content penalty' as a penalty per se, more a discounting of the value of any content that is identified as a duplicate of some other content that is counted.

I might be misunderstanding what you meant by "discounting of the value" and "counted", but the sources I've read so far seem to say that, behind the scenes, duplicate content is automatically bundled together under one canonical URL by Google. In this case it could mean that, for an example, all links to example.com/foo and example.com/foo/ would count towards the version that Google deems "primary", and it would also be the only one they display in their search results (unless the user specifically chooses to show duplicate content).

Possibly the most common problem with duplicate content is that Google could choose a different version as the primary one than what you might prefer, unless you use canonical tags to advice them. Probably the most fearsome problem, on the other hand, would be that they could think that you're trying to copy same content over and over as an attempt to "cheat", in which case they could remove some pages, or even the whole site, from their search index. But again, I highly doubt that they could ever interpret a trailing slash issue as such an attempt :)

I must admit that crawl budget was a new concept for me. After reading a bit about it, I'd say that it definitely won't be an issue for the vast majority of us here (first of all in a blog post they say that it usually only affects sites with thousands of pages), but it's definitely something that very large sites, or sites that auto-generate URLs in some way, should take into consideration. Anyway, thanks for sharing this point of view! :)

  • Like 1
Link to comment
Share on other sites

2 minutes ago, teppo said:

all links to example.com/foo and example.com/foo/ would count towards the version that Google deems "primary"

Absolutely - Google is quite often wrongly thought to be the enemy. Not at all, unless people are trying to cheat in some way. They actually do their best to understand broken site architecture, which is something that PW does a great job of helping us avoid anyway.

And we can easily go for a belt & braces approach by adding

<link rel="canonical" href="<?=$page->url?>">

in our site's <head>...</head>, letting PW handle it. (Might very well be unnecessary, but can't hurt.)

  • Like 1
Link to comment
Share on other sites

  • 6 months later...

It seems that when using ProCache there is no redirect, both pages produce a status 200. SEO experts/tools seems to feel this is a fault with PW. Adding no or several /// trailing slashes all return a regular undirected page.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...