Title: Permalink Rewrite
Last modified: August 20, 2016

---

# Permalink Rewrite

 *  Resolved [Michael Moore](https://wordpress.org/support/users/imikedesigns/)
 * (@imikedesigns)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/permalink-rewrite-1/)
 * I’m currently using the permalink structure /%category%/%postname%.html. But,
   I have tons of hard coded links to posts from a previous permalink structure 
   of /%year%/%postname%. Currently, [http://www.url.com/2009/post-name.html](http://www.url.com/2009/post-name.html)
   works but [http://www.url.com/2009/post-name](http://www.url.com/2009/post-name)
   does not. Can anyone point me in the write direction as to how to make that sturcture
   work, or to append .html onto posts with the structure?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/permalink-rewrite-1/#post-3296838)
 * 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/](http://lorelle.wordpress.com/2005/12/01/search-and-replace-in-wordpress-mysql-database/)
 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/permalink-rewrite-1/#post-3296840)
 * One more thing [@imikedesigns](https://wordpress.org/support/users/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/](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.
 *  Thread Starter [Michael Moore](https://wordpress.org/support/users/imikedesigns/)
 * (@imikedesigns)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/permalink-rewrite-1/#post-3296843)
 * 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.
 *  Thread Starter [Michael Moore](https://wordpress.org/support/users/imikedesigns/)
 * (@imikedesigns)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/permalink-rewrite-1/#post-3296853)
 * 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 ‘Permalink Rewrite’ is closed to new replies.

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Michael Moore](https://wordpress.org/support/users/imikedesigns/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/permalink-rewrite-1/#post-3296853)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
