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} !^http://sample.com/.*$ [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:

<VirtualHost 10.10.20.22:80>
 ServerName phpsite.ru
 ServerAlias www.phpsite.ru
 DocumentRoot /var/www/html/phpsite.ru/public
 <Directory /var/www/html/phpsite.ru/public >
    Options FollowSymLinks
    AllowOverride All
    Require all granted
 </Directory>
 ErrorLog /var/www/html/phpsite.ru/public/logs/error.log
 CustomLog /var/www/html/phpsite.ru/public/logs/access.log common
</VirtualHost>

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