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/(.*) [R=301,L]
#each category
RewriteRule ^country/(.*) [R=301,L]
RewriteRule ^state/(.*) [R=301,L]
RewriteRule ^language/(.*) [R=301,L]

No comments:

Post a Comment