[英]The condition pattern is not supported: -l convert .htaccess to web.config
我使用import將htaccess轉換為iis上的web.config,但收到消息“不支持條件模式:-l”。 其中-l是htaccess中的RewriteCond%{REQUEST_FILENAME}!-l,
htaccess
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]
輸出量
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.+)$" ignoreCase="false" />
<conditions>
<!--# Necessary to prevent problems when using a controller named "index" and having a root index.php-->
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<!--The condition pattern is not supported: -l.-->
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
web.config支持如何使-l,因為如果不使用-li可以打開我的網站並顯示錯誤“ 404-找不到文件或目錄”。
謝謝
從RewriteCond
指令的文檔中獲取:
-l
是符號鏈接。
將TestString視為路徑名,並測試它是否存在,並且是符號鏈接。 如果有混淆的可能,例如使用
-lt
或-le
測試時,也可以使用-L
或-h
的bash約定。
由於在Windows中沒有符號鏈接的概念,因此您不需要此條件。 您指定的其他兩個條件已經涵蓋了它:
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.