Forum Moderators: phranque
I need to redirect a post like: www.my-blog.com/?p=13 to www.my-blog.com/post-name
What rules do you need to do this? Thanks for your help!
You can't do this with a simple .htaccess rule. You'll need to modify the wordpress script to examine the requested parameter-based URL, look up the post-name in the posts database, and then issue a 301 redirect to the new URL.
There is a major problem looming should you ever use the exact same post name on another post at some point in the future.
There is nothing wrong with indexing of URLs with one parameter in them. I would have stuck with doing that.
There is a major problem looming should you ever use the exact same post name on another post at some point in the future.
My experience with WordPress is that it automatically detects possible duplicate post names and it will automatically add a sequence number to the URL when necessary. I.e. "a-post-name" becomes "a-post-name-2", the second time the title "A post name" is assigned to a post.
Redirect 301 /?p=13 http://www.example.com/post-name
Redirect 301 /?p=14 http://www.example.com/post-name
Redirect 301 /?p=15 http://www.example.com/post-name
and so on
[edited by: jdMorgan at 6:13 am (utc) on Jan. 8, 2008]
[edit reason] example.com [/edit]