Forum Topic: how to test htaccess rules

Forum: .htaccess Forum : General • Posted by RememberToForget • Updated:

I see in my error logs that I'm getting some traffic from an especially depraved porn site, e.g., children, etc.

I've decided to go with the technique where you just redirect all traffic coming from this site back onto itself:

RewriteCond %{REQUEST_FILENAME} .*
RewriteCond %{HTTP_REFERER} pornoforadult\.com [NC]
RewriteRule .* http://pornoforadult.com/ [R=301,L]

Is there some online tool that can check various htaccess rules and tell you if they're working or not? I'm not finding much.

2 Replies to “how to test htaccess rules”

Jeff Starr
Posted by Jeff Starr

I've seen some nice online tools but nothing (yet) for checking the referrer. If you find something and let me know I'll definitely add it to the list. In the meantime, it would be safe to assume that the self-redirect is working if the associated errors (depraved sites, et al) disappear. Also compare normal (good) traffic to check that it's not been adversely affected by the htaccess directives.

Posted by RememberToForget •

Got it; thanks.