How do I redirect a WordPress site with htacces file?

QuestionsCategory: BloggingHow do I redirect a WordPress site with htacces file?
Avatar for techshristitechshristi asked 1 year ago

I want to change the Permalink structure of my WordPress website. How to change the current permalink structure to /%postname%/, without getting any 404 Not Found errors on my website.

1 Answers
Avatar for Love U MarketingLove U Marketing Staff answered 1 year ago

Very simple. if you want to change your current Permalink structure to /%postname%/, then you can create the same with the help of this free tool.
Free tool created by the Yoast, can generate redirects from your old permalink structure to the permalink/%postname%/ structure.
All you need to do is just fill the necessary information and click ‘Generate Redirect’ to get the redirect code. Now, copy and paste this code in your htacces file.


That’s it. It will automatically redirect your old permalinks to new permalinks without any problem.
Note:

  • It only creates the redirect rule when you want to change the permalinks structure to Post Name structure.
  • For rest, it will not work. So, if you want to create redirect rule for any other kind of Permalink then this will not work.

 

Your Answer

8 + 11 =