SCENARIO A
I have an wordpress site that has existing posts.
Permalink structure is currently configured to https://sitename.com/%postname%/
I need to change the Permalink structure to https://sitename.com/%category%/%year%/%monthnum%/%day%/%postname%/
but when I save these settings https://sitename.com/%postname%/
results to 404 does not redirect to https://sitename.com/%category%/%year%/%monthnum%/%day%/%postname%/
When I remove the /%category%/ and just use https://sitename.com/%year%/%monthnum%/%day%/%postname%/
the 301 redirection from https://sitename.com/%postname%/
works fine
Is there a better way to achieve changing to https://sitename.com/%category%/%year%/%monthnum%/%day%/%postname%/
with proper redirections from https://sitename.com/%postname%/
?
Note: I already deactivate all plugins and just used the default twentytwenty theme. I have 11,000 existing posts.
SCENARIO B
(if Scenario A does not work or there is no solution to Scenario A. Im looking at option Scenario B)
Currently I have this but I’m not sure it’s working properly. When I apply this it seems to work for posts that are under “Local News” category. However it breaks my PAGES. PAGES result in 404s.
Is this a correct approach or is my code correct? I’m also not sure if the rewrite rules I made affects other things. Basically I just want to retain permalink/url of the old posts and moving forward I want to follow the new permalink settings. I’m avoiding old posts to result in 404 pages.
Thanks
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com