Monday, December 27, 2021

How to Disable Category Listing in Wordpress Using .htaccess

Here's how to disable category listing in WordPress using .htaccess. 

Place this at the top before # BEGIN WordPress and # BEGIN iThemes Security and other security plugins.

 
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^category/(.*) https://yoursite.com/your/new/url [R=301,L]
#each category
RewriteRule ^country/(.*) https://yoursite.com/your/new/url [R=301,L]
RewriteRule ^state/(.*) https://yoursite.com/your/new/url [R=301,L]
RewriteRule ^language/(.*) https://yoursite.com/your/new/url [R=301,L]
</IfModule>

No comments:

Post a Comment