Using Mod_Rewrite To Block Referrer Based On Domain Extenstion?
- by Matt
I've been in web development for several years now (I'm a student web designer), and recently, I've begun to experiment with mod_rewrite for things like URL shortening.
I was wondering, is it possible to block a referrer by domain extension, instead of just by full site, etc.?
So, instead of
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} examplesite\.com [NC]
RewriteRule .* - [F]
could you do
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} \.com [NC]
RewriteRule .* - [F]
without the full domain name?
Thanks. I'm fairly knowledgeable about other web dev / hosting topics, but mod_rewrite is new to me and Google wasn't helping.