Make WordPress Core

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#20224 closed enhancement (wontfix)

WordPress should always add a / at the end of URLs

Reported by: confridin's profile Confridin Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: Canonical Keywords:
Focuses: Cc:

Description

Users can change permalinks. They can add whatever they whant at the end of each url. For example :

  • mydomain.com/myurl
  • mydomain.com/myurl/
  • mydomain.com/myurl.php
  • mydomain.com/myurl.html
  • mydomain.com/myurl.htm
  • ...

There is a bug with search engines and empty URLs (mydomain.com/myurl). Google, Yahoo or Bing consider that it's not the same URl as mydomain.com/myurl/. They always try to add a / at the end of those URLs : it creates duplicate content for search engines that harms website visibility. For example, if a WordPress Blog uses /%postname% as permalink, Google is going to index both url:

  • mydomain.com/myurl
  • mydomain.com/myurl/

In order to correct this issue, WordPress should always add a / at the end of empty URLs (for example, without a / or without extension like .php, .asp, .html, ...).

Change History (8)

#1 @scribu
13 years ago

  • Component changed from Rewrite Rules to Canonical
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

WordPress already does this, depending on your permalink structure.

  • if it ends with a slash, say /%postname%/, it always redirects to the slashed version.
  • if it doesn't end with a slash, say /%postname%, it always redirects to the non-slashed version.

#2 @Confridin
13 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Hello,

I already know that users can avoid this issue.

But I think this is a bug : users shouldn't be able to use /%postname% without an ending / or extension. They are reducing their visibility on every search engine, and they are creating duplicate content.

#3 @scribu
13 years ago

  • Keywords 2nd-opinion added; needs-patch removed
  • Milestone set to Awaiting Review

#4 @SidHarrell
13 years ago

I think the kind term is "user-proofing". Maybe add a warning to the text on the permalink settings page, but I wouldn't think it would be WP core dev team responsibility to keep site owners from shooting themselves in the foot.

Oh, you probably meant a 2nd-opinion from a core team member. Nevermind. :)

#5 @Confridin
13 years ago

SidHarrell has a point.

We may not change permalink structure, but WordPress should warn users about bad peramlink structure without an ending / or extension.

#6 @nacin
13 years ago

  • Keywords close added; 2nd-opinion removed

Can we have some evidence that a URL not ending in / is bad? Because I'm not familiar with that at all. As long as one 301 redirects to the other, things are fine. http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html

And WordPress does exactly this for all URLs, based on whether your custom permalink structure ends in a trailing slash. This was implemented in #1485.

#7 @c3mdigital
12 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

#8 @SergeyBiryukov
12 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution changed from invalid to wontfix
Note: See TracTickets for help on using tickets.