Category Archives: asp.net-core-1.1

.htaccess equivalent in .NetCore

To allow video to be played in element from my website, but not allowing it through direct link, I created .htaccess in a sub-directory with the source videos, and nothing else. with the below code:

RewriteEngine On
RewriteCond %{REQUEST_URI} \.(mp4|mp3|avi)$ [NC]
RewriteCond %{HTTP_REFERER} !^http://sample.com/.*$ [NC]
RewriteRule ^.* - [F,L]

I need to do the same with .NetCore server, but do not know how?

Any help. thanks.