不支持条件模式:-l将.htaccess转换为web.config

时间:2016-07-21 02:18:02

标签: apache .htaccess mod-rewrite iis

我在iis上使用import将htaccess转换为web.config,但我收到消息'不支持条件模式:-l。'其中-l是rewriteCond%{REQUEST_FILENAME}!-l in htaccess,

htaccess的

A

输出

Options -MultiViews
RewriteEngine On
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

如何使-l在web.config中受支持,因为如果不使用-l我可以打开我的网站并收到错误" 404 - 找不到文件或目录。"

thankyou

1 个答案:

答案 0 :(得分:0)

RewriteCond directive's文档中提取:

  

-l

     

是符号链接。

     

将TestString视为路径名并测试它是否正确   存在,是一种象征性的联系。也可以使用-L的bash约定   或-h如果有可能混淆,例如使用-lt时   或-le测试。

由于在Windows中没有符号链接的概念,因此您不需要这种情况。它已经被您指定的其他两个条件所覆盖:

<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />