Skip to content

Instantly share code, notes, and snippets.

@hakikz
Created January 2, 2022 07:41
Show Gist options
  • Save hakikz/562098a8cf01a5ef1cd9ba314dc6842d to your computer and use it in GitHub Desktop.
Save hakikz/562098a8cf01a5ef1cd9ba314dc6842d to your computer and use it in GitHub Desktop.
Protect file from direct access but get it using API call
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost.*$ [NC]
RewriteRule \.(zip|php)$ - [F]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment