Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
    
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.