boxturt Posted February 25, 2006 Posted February 25, 2006 (edited) I just need to clarify that the [L] at the end of a RewriteRule means the end.........of what? Does it need to be the very last thing in htaccess? Or does it matter? >order allow, deny deny from 1**.***.**.**1 deny from 2**.***.**.**2 allow from all RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^grabber1 [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^grabber2 [NC] RewriteRule .* - [F] RewriteCond %{HTTP_REFERER} (spamproduct1) [NC,OR] RewriteCond %{HTTP_REFERER} (spamproduct2) [NC] RewriteRule .* - [F] RewriteCond %{HTTP_REFERER} (badsite\.info) [NC,OR] RewriteCond %{HTTP_REFERER} (baddersite\.com) [NC] RewriteRule .* - sorry-dude.php [L] Redirect permanent /hints.html http://mysite.com/home.html The above is severely edited but the format is correct? I can keep adding conditions as long as the [L] is at the end? I'm sure you can tell I'm a little confused, I can't even phrase the question intelligently. As always, thanks. Edited February 25, 2006 by boxturt Quote
TCH-JimE Posted February 25, 2006 Posted February 25, 2006 (edited) Hello, Correct, [L] must go at the very end of everything, its the last rule of the REWRITE engine. You can place other bits afterwords, just as long as its nothing to do with REWRITE. Other then that, it all looks healthy! Jimuni Edited February 25, 2006 by Jimuni Quote
TCH-Rob Posted February 25, 2006 Posted February 25, 2006 'last|L' (last rule) Stop the rewriting process here and don't apply any more rewriting rules. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL ('/') to a real one, e.g., '/e/www/'. You can have more than one [L] in your htaccess. It just means the end of that rule for that specific purpose. Quote
boxturt Posted February 25, 2006 Author Posted February 25, 2006 Hmmmm............ so I can have but don't need to have? This is where I get lost. I did have [L] after each RewriteRule but it seems to stop reading at that first one, eg: >RewriteEngine On RewriteCond %{HTTP_REFERER} (spamproduct1) [NC,OR] RewriteCond %{HTTP_REFERER} (spamproduct2) [NC] RewriteRule .* - [F,L] RewriteCond %{HTTP_USER_AGENT} ^grabber1 [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^grabber2 [NC] RewriteRule .* - [F,L] RewriteCond %{HTTP_REFERER} (badsite\.info) [NC,OR] RewriteCond %{HTTP_REFERER} (baddersite\.com) [NC] RewriteRule .* - sorry-dude.php [L] So it doesn't seem to get past the first rule, and what seems to have happenned is the rules for denying grabber bots are getting ignored. So 30,000 hits later......... Quote
TCH-JimE Posted February 26, 2006 Posted February 26, 2006 Have you tried [R,L] instead of [F,L] Jimuni Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.