Thursday, February 3, 2022

Disable Year Month Listing efficiently for Wordpress Using .htaccess











Here's how to "disable" redirect URLs with Year/Month efficiently 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 /

#redirects yoursite.com/2022/01 to new url - Wed 02-Feb-22 8:34pm metadataconsulting.ca - 
RewriteRule ^\d{4}\/\d{2}/(.*)$ https://yoursite.com/your/new/url [R=301,L]
RewriteRule ^\d{4}\/\d{2}$ https://yoursite.com/your/new/url [R=301,L]

</IfModule>

No comments:

Post a Comment