Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
htaccess redirect question redirect entire directory except one file santapaws msg:4621548 12:01 pm on Nov 6, 2013 (gmt 0) Hi Just trying to figure how to write a redirect 410 for an entire directory except for a single file that is to be 301'd to a new location. tx.
phranque msg:4621691 10:45 pm on Nov 6, 2013 (gmt 0)
first, a RewriteRule with the [R=301,L] flag to handle the more specific file redirect. then, a separate RewriteRule using the [G] flag to provide the 410 status code for the more general directory case. santapaws msg:4621694 10:54 pm on Nov 6, 2013 (gmt 0)
does that L flag stop any rules from running or just the next rewrite rule? tx.
phranque msg:4621715 12:26 am on Nov 7, 2013 (gmt 0)
The [L] flag causes mod_rewrite to stop processing the rule set. it's more complicated than that, so you should really read and understand the entire section. lucy24 msg:4621720 1:13 am on Nov 7, 2013 (gmt 0)
does that L flag stop any rules from running or just the next rewrite rule? tx. Each module is an island. So even if mod_rewrite has already handed out a decisive 403, all the other mods still have to run. Ordinarily you list rules in order of severity, so a 410 would come before a 301. But sometimes-- like here-- it's more practical to put some rules out of sequence.