0

I have a domain with permalinks set to

/%postname%/ 

but now I would like to change to

/%category%/%postname%/ 

I thought who ever now come from a book mark to http://domain.com/my-first-post will automatically go to http://domain.com/category-name/my-first-post but instead it shows "not found". Is canonical built in feature by default? If not how to enable it? I use the SEO plugin that came with Genesis.

I checked this https://yoast.com/wp-content/permalink-helper.php but doesn't help in my case to get the redirectmatch as its different approach. Using a plugin is not helping as I have to manually type in all the urls.

Can someone please advise me on how to handle this either fix canonical or using redirectmatch rule via .htaccess?

regards

4
  • It should be your solution Redirect 404 errors after permalink change – m4n0 Apr 27 '15 at 18:25
  • By the way, WordPress handles canonical URLs and if you change the post slug, WP performs the redirection automatically to the new URL. But you have changed the permalink structure and canonical structure changes with that settings too; redirection from old permalink settings to new settings are not done automatically. – cybmeta Apr 27 '15 at 18:27
  • @ManojKumar thanks! can you let me know where that function should be called from? functions.php?or a new file? please advise. – JDesigns Apr 27 '15 at 19:21
  • @Jay Yes! functions.php file. 99% of the time, the custom PHP code goes there :) – m4n0 Apr 27 '15 at 20:01