How To Protect wp-config.php File With .htaccess

How To Redirect Dead-End Category, Search And Tag URLs In WordPress

Since WordPress 2.5, WordPress automatically handles many redirections on your blog. If you’re using a pretty permalinks in your blog, WordPress will redirect the following three URLs results in 404 (Page Not Found) errors:

  • http://www.example.com/tag/
  • http://www.example.com/category/
  • http://www.example.com/search/

These three pages doesn’t exist by default. However, a visitor of your website and search engines, such as Google, may attempt to load these pages. It will lead them to the 404 error page, which will harm your website’s search engine position.

It will better to redirect dead-end category, search and tag URLs in your WordPress to your homepage to extract any leftover search engine rank juice.

Thanks to DigWP.com, we can accomplish this job by adding following code to .htaccess file:

Don’t forget to enter your website URL in above code. Plus, if your WordPress install is located in a sub-directory called “blog”, use this code instead: