Title: htaccess redirect doesn&#039;t work
Last modified: August 22, 2016

---

# htaccess redirect doesn't work

 *  Resolved [bonda](https://wordpress.org/support/users/bonda/)
 * (@bonda)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-redirect-doesnt-work/)
 * I have a new WP installation in the folder called “new”, but there are many sites
   and search engines out there that keep on pointing to the old URLs (the old WP
   was in the root dir).
 * Old post URLs:
    `www.domain.com/year/month/day/category/post-title/` New WP installation’s
   posts URLs: `domain.com/new/post-title/`
 * The **post titles are the same**.
    How could I redirect them all at once to the
   new URLs?
 * I have tried the Redirect plugin, but the old WP installation is corrupt and 
   doesn’t work properly.

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

 *  [barnez](https://wordpress.org/support/users/pidengmor/)
 * (@pidengmor)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-redirect-doesnt-work/#post-5264329)
 * Some useful htaccess redirect rules here you could try:
    [http://perishablepress.com/stupid-htaccess-tricks/#red3](http://perishablepress.com/stupid-htaccess-tricks/#red3)
 *  Thread Starter [bonda](https://wordpress.org/support/users/bonda/)
 * (@bonda)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-redirect-doesnt-work/#post-5264341)
 * Thank you, Barnez. I have tried both of their examples, but they don’t work in
   my case (“Page no found”). They suppose that inside the new directory the path
   is of the same type (year/month/day/category/post-title), and it’s now simply*.
   com/new/post-title
 * **This one works:**
 * `Redirect permanent /2010/05/14/news/ http://wariscrime.com/new/`
 * But the problem is how to make it work for ANY year/month/day…
 *  Thread Starter [bonda](https://wordpress.org/support/users/bonda/)
 * (@bonda)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-redirect-doesnt-work/#post-5264361)
 * Thank you. After a series of tests, this one works:
 * `RedirectMatch 301 ^/[0-9]{4}/[0-9]{2}/[0-9]{2}/([a-z0-9\-/]+) http://wariscrime.
   com/new/$1`
 *  [barnez](https://wordpress.org/support/users/pidengmor/)
 * (@pidengmor)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-redirect-doesnt-work/#post-5264369)
 * Fantastic news! Did you find the rule at Perishable Press?
 *  Thread Starter [bonda](https://wordpress.org/support/users/bonda/)
 * (@bonda)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-redirect-doesnt-work/#post-5264378)
 * Yes. But I didn’t know much about regular expressions before, so their examples
   were kind of Chinese for me. So, to adapt them, I had to learn a bit their meaning
   first. Fortunately, it’s all very well explained on the same page 🙂
 *  [barnez](https://wordpress.org/support/users/pidengmor/)
 * (@pidengmor)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-redirect-doesnt-work/#post-5264384)
 * It’s a great resource, and congratulations on a courageous htaccess adaptation–
   we all know what happens when the code is flawed.

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

The topic ‘htaccess redirect doesn't work’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [barnez](https://wordpress.org/support/users/pidengmor/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-redirect-doesnt-work/#post-5264384)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
