I am converting .htaccess file to rewrite rules in IIS to convert from http to https, all the rules are being converted which starts with RewriteCond
but deny from all
is not converted
I want to convert this htaccess rule to IIS rewrite rule
<Files ~ "\.log$">
Deny from all
</Files>
Is there any other way to convert it? or I doing something wrong.
to convert this rule you could use the request filtering feature of iis or URL rewrite.
<configuration>
<security>
<requestFiltering>
<fileExtensions>
<add fileExtension=".log" allowed="false" />
</fileExtensions>
</requestFiltering>
</security>
</system.webServer>
</configuration>
using url rewrite rule:
<rule name="Protect files and directories from prying eyes" stopProcessing="true">
<match url="\.log$" />
<action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." />
</rule>
for more detail please refer this link:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.