I have an old wordpress blog that I need to redirect all posts to a new system but the url is slightly different, where the day of the post is removed. For example, the old url is like this:
http://www.myolddomain.com/2012/11/30/the-title-of-my-post/
But the new url is like this:
http://www.mynewdomain.com/blog/2012/11/the-title-of-my-post
I’m having a hell of a time getting it to rewrite correctly. I keep getting the message that the url is not found (404) but on the old server. So it’s not redirecting. Here’s my current htaccess entry:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^/([0-9]+)$/([0-9]+)$/([0-9]+)$/([0-9]+)$ http://www.mynewdomain.com/blog/$1/$2/$4[R=301,L]
I appreciate any advice.
Try with:
The
$symbol (that means,end) should be appended only at the end (if necessary!).Tested here and it works.