我試圖導入.htaccess
文件到URL重寫規則在IIS 7導入時出現問題的.htaccess到IIS URL重寫程序Web.Config
中的Symfony 2當前文件失敗將它導入到IIS。我需要知道語法的人的幫助以將文件轉換爲IIS可用的文件,這吸引了這項工作對IIS中Symfony 2的未來用戶的幫助。
我很抱歉不知道IIS中的語法。我附加了原始文件/web/.htaccess
,爲方便起見,排除了所有註釋。
在此先感謝
DirectoryIndex app.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteRule .? %{ENV:BASE}/app.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /app.php/
</IfModule>
</IfModule>
電流誤差輸出是這樣的:
<rewrite>
<rules>
<!--The rule cannot be converted into an equivalent IIS format because of unsupported flags: E-->
<!--This rule was not converted because it contains references that are not supported: 'ENV::BASE'-->
<rule name="Imported Rule 3" stopProcessing="true">
<match url=".?" ignoreCase="false" />
<conditions>
<!--# If the requested filename exists, simply serve it.-->
<!--# We only want to let Apache serve files and not directories.-->
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
</conditions>
<action type="None" />
</rule>
<!--This rule was not converted because it contains references that are not supported: 'ENV::BASE'-->
</rules>
</rewrite>
在此先感謝
,讓說__foo__我怎麼需要格式化規則以這種方式工作 – Rafael
檢查....:D – Rafael