Category Archives: .net-core

.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} !^*$ [NC]
RewriteRule ^.* - [F,L]

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

Any help. thanks.

Apache with PHP and .NET Core at the same time

Lets imagine we have two different apache virtual hosts and we want one host to be php web-site and the other one - .net core. The simple question - how to configure apache (httpd.conf/php.conf) to make this happen? For php we already have directives: AddHandler php5-script .php and AddType text/html .php, for the php virtual host we have settings:

 DocumentRoot /var/www/html/
 <Directory /var/www/html/ >
    Options FollowSymLinks
    AllowOverride All
    Require all granted
 ErrorLog /var/www/html/
 CustomLog /var/www/html/ common

What should we do to make a second virtual host handle through .net core?