i am using these permalinks settings
Month and name
and now want to move it to
Post name
and i have 1500 posts so if i changed it now it gives 404 errors
now this can be possible by htaccess but no idea
https://www.inmotionhosting.com/support/website/redirects/setting-up-a-301-permanent-redirect-via-htaccess
so anyone can help me with to fix this
thanks guys
]]>Are you doing this from admin Permalink settings ?
If yes, then May be it’s a issue of .htaccess file write permission.
Please check whether your htaccess has write permission ?
you will get an error when you save the permalinks setting from admin.
]]>so what htaccess code i need to be write to make that work with all the posts redirects correctly
]]>You do not need to edit htaccess file. Once you change the settings in permalink, htaccess will be automatically updated(if you have proper file permission set).
You can change permalink setting as describe in this screen shot. https://prnt.sc/i84710
Also if you change the permalink your old post will be automatically redirected to the new URL. So it wont give you 404 error.
]]>well i want that htaccess setting by that my post will get redirects easily after selecting that settings
so you have any idea on htaccess settings than post it rest i know
]]>You need to add following code in htaccess. Replace “example.com” with actual site name.
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(?!page/)(.+)$ https://example.com/$3
You can generate the htaccess code using following URL.
https://yoast.com/research/permalink-helper.php
Ref: https://yoast.com/change-wordpress-permalink-structure/
]]>