Support » How-To and Troubleshooting » [Resolved] Permalink Rewrite

[Resolved] Permalink Rewrite

Viewing 4 replies - 1 through 4 (of 4 total)
  • Christine Rondeau


    Volunteer Forum Moderator

    If those links are hard coded in your posts, you may need to update them in your database.

    I would do a search and replace of the links in the wp_post.
    Lorelle wrote a good post about this here – http://lorelle.wordpress.com/2005/12/01/search-and-replace-in-wordpress-mysql-database/

    Christine Rondeau


    Volunteer Forum Moderator

    One more thing @imikedesigns, I’m not sure that the .html extension works on pages.
    You might need a plugin like this one – http://wordpress.org/extend/plugins/html-on-pages/

    But it’s very old. I would reconsider adding the .html personally.
    I’m not sure there’s any benefit.

    Thanks for the reply. But I can’t think of a way to search and replace them because they are all different links. It would bascially be a manual update of 1200 links at that point. Im hoping this can be done with .htaccess or or an add_rewrite_rule. Im just unsure of the regex to use.

    Thanks Christine. Reading your post, I realized youre right. There is no reason to use .html. But, I still had .html hardcoded links as well. So, I removed .html from my permalink structure added

    # Rewrite .html to postname/
    RedirectMatch 301  ^/([^/]+)/([^/.]+)\.html$ /$1/$2/
    RedirectMatch 301  ^/([^/]+)/([^/]+)/([^/.]+)\.html$ /$1/$2/$3/

    to my .htaccess to redirect those hardcoded .html links to /category/postname structure links. Works great.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Permalink Rewrite’ is closed to new replies.