Using a RewriteRule to change to 410

#1
I've been trying a few rules and nothing seems to work. All I want to do is change the error from 404 to 410 whenever someone (specially Google's bot) tries to access the subdirectory /forums/*
RewriteRule ^forums/ - [G]
Does not work
 

Cold-Egg

Administrator
#4
I changed the forums to another string, but yeah, it works. Maybe you can try to move this line to the top of the .htaccess file.
 
#5
Cool, that worked (putting it at the begging of the file). Wonder what blocked it? Considering I only have the stuff from LS Cache WP plugin and WordPress default.
 

Cold-Egg

Administrator
#6
There is a minor difference in the way LiteSpeed Web Server and Apache treat the [L] flag in rewrite rules. The [L] flag (“L” stands for “Last”) causes mod_rewrite to stop processing the ruleset. There are two ways to interpret this:

  1. In most contexts, including LiteSpeed Web Server, this means that if the rule matches, no further rules will be processed. LSWS exits from the rewrite completely to avoid looping.
  2. In Apache, [L] means that if the rule matches, no further rules will be processed in the current iteration. Apache does not exit from the rewrite rule completely, and so there is a possibility of looping.
 
Top