Redirecting from “d & m” to “post name” permalink format issue
-
I need help fast. We just migrated a wordpress.com blog to self hosted, paid for the redirect on wordpress.com and on our self hosted wordpress website we wanted to change the permalink format from “day and month” (/2017/12/31/postname) to “post name” (/postname) which would break the paid wordpress.com redirect, so we needed to create an internal redirect that redirects from day and name permalink format to post name permalink format. I added the redirect rule to htacces that does exactly this, and noticed in google analytics that a bunch of people coming from google search are directed to 404 pages. Prior to finding this out, I tested the redirect on desktop by googling one of our posts, and the redirect worked fine. However, when I tested it on android phone in chrome, it seems to add /amp behind the url (/postname/amp) for some reason which returns error 404.
The rewrite rule I added to htaccess:
<IfModule mod_rewrite.c>
RewriteRule ^[0-9]{4}/[0-9]{2}/[0-9]{2}/(.*)$ /$1 [R=301,L]
</IfModule>
I need to fix this asap because by paying for the redirect on wordpress.com the website has been officially launched and now a bunch of people googling for our posts are directed to 404 page. Can anyone help me out with this?Addendum: I forgot to mention that some of the posts are redirected fine on android and most are directed to postname/amp, so I’m guessing the rewrite rule is not fully correct.
- The topic ‘Redirecting from “d & m” to “post name” permalink format issue’ is closed to new replies.