Mobile app version of vmapp.org
Login or Join
Deb1703797

: Prevent hotlinking of attachments People are able to embed my forum's attachments (vbulletin). I tried to create an htaccess rule for the hotlinking, but it did not work. RewriteCond %{HTTP_REFERER}

@Deb1703797

Posted in: #Apache #Hotlinking #Htaccess

People are able to embed my forum's attachments (vbulletin).
I tried to create an htaccess rule for the hotlinking, but it did not work.

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com.*$ [NC]
RewriteRule attachmentid=d+(&d=d*)?|.([Gg][Ii][Ff]|[Jj][Pp][Gg])$ mydomain.com/antihotlink.jpeg [R]


Is it not possible to check for numbers in regular expressions in htaccess files?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gonzalez347

You have to use RewriteCond %{QUERY_STRING} to match against the query string -- rewriterule matches only against the path component of the URL.

That's why your rule is a no-op.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme