WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I update my permalink structure to /post/%post_id%/%postname%, but if someone uses a URL like /post/1234 instead of the full URL of /post/1234/bingo-rulz, WordPress shows the post without giving a 301 to the full URL. Isn't this poor SEO? Sites like tumblr and stackexchange auto 301 to the full URL. Any hacks/code/plugins/settings/etc to fix this? thanks

p.s. /post/1234/blah does get a 301 to /post/1234/bingo-rulz but /post/1234 does not and ends up in two separate URLs to the same content.

share|improve this question
up vote 0 down vote accepted

Think I found a solution... Since anything after the %post_id%/__ will redirect to the full slug, a simple RewriteRule in the .htaccess file appears to do the trick. I had to place it above other RewriteRules and this is working for me.

RewriteRule ^post/(\d*)/?\z$ http://noahcoad.com/post/$1/a [R=301,L]

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.