Home How to deny access to a file name in .htaccess
Reply: 1

How to deny access to a file name in .htaccess

Bharat Sharma
Bharat Sharma Published in 2018-01-12 15:26:04Z

Please Help! I am trying to forbid visitors to access the following file name ?file=: Only work with my domain like we do Hotlink protection


Try this

RewriteCond %{HTTP_REFERER} !^domain.com$ [NC]

RewriteEngine On RewriteRule (^|/)file(/|$) - [F,NC]

but what I have above does not work: I can still access the file from the browser remotely.

starkeen Reply to 2018-01-13 14:48:07Z

You can use this rule :

RewriteEngine  on

RewriteCond  %{HTTP_REFERER} !domain\.com$
RewriteCond  %{THE_REQUEST} /inscription/\?file= [NC]
RewriteRule ^ - [F,L]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30847 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO