Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Do Permalinks with Custom Structure need end slashes?

         

deeper

10:11 pm on Sep 13, 2014 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi,
according to
[codex.wordpress.org...] it needs an end slash:

Custom structure : /%postname%/

It seems at least to be recommended, without explicitly giving reasons.

Google shows me webmaster dropping the slash however and only recommend consistently linking without slash.

Others talk about duplicate content.

Is there a good reason for using the slash like codex suggests?

Because of internal URL rewrite after relaunch with WP I'd like to drop the slash, so URLs for pages like site.com/page1.html ---> site.com/page1 is possible
Discussed at [webmasterworld.com...]

lorax

2:44 am on Sep 14, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do you NEED them? I'm not sure about this. Every test I've run on my sites using a URL without the trailing slash has resolved to the proper location WITH the trailing slash put back in place. Can you force WordPress to ignore them, yes.

SHOULD you use them? Considering the coders recommend you use them (they make it so by default), I would err on the side of believing there's a reason for including them ....

The duplicate content issue that lucy24 notes:
If there's no 301, just server-internal activity, it isn't a redirect. It's a rewrite. This leaves you vulnerable to Duplicate Content if you've got an old URL (rewritten) side by side with a new URL, and both lead to the same page.
has to do with rewriting the URL instead of redirecting the URL. If you use a URL on a WordPress site without the trailing slash you should be redirected to the page WITH a trailing slash. On my sites, the server delivers a 301 redirect so there's no duplicate content issue.

If you mess with the permalink structure by using a plugin or modifying htaccess, you're on your own. Considering Google seems to like most WordPress sites straight out of the box, I'd encourage you to leave it as it is and focus on writing good content and organizing it in a useful and meaningful way for your visitors.

My personal opinion is to go with the URL structure provided by WordPress. You'll take a hit for a short bit while Google figures out what happened (assuming we're still talking about converting a site that used .html or .php files to WP) but if you use a plugin like Redirection or similar and submit proper site maps to WMT, then you should come out of the woods pretty quickly. I think you'll be headed for more headaches in the long run by trying to twist WordPress permalinks to your will.

deeper

1:35 am on Sep 17, 2014 (gmt 0)

10+ Year Member Top Contributors Of The Month



Some say without slash server (or WP) initiates a redirect and this of course then takes time.