1
我在我的IIS mod_rewrite模塊中導入.htaccess文件時出現問題。 出現3個錯誤。.htaccess IIS mod_rewrite
.htaccess`
Options +FollowSymLinks -Indexes -MultiViews AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine On
##If your NeoFrag directory is not at http root
##you need to replace "/" by the correct directory, for example "RewriteBase /neofrag/"
RewriteBase/
##Allow direct access to specific directories
#RewriteCond %{REQUEST_URI} ^/(dir1|dir2)/
#RewriteRule .* - [L,QSA]
RewriteCond %{REQUEST_URI} !^/backups/
##Allow direct access to specific files
#RewriteCond %{REQUEST_FILENAME} /file1\.php [OR]
#RewriteCond %{REQUEST_FILENAME} /file2\.php [OR]
RewriteCond %{REQUEST_FILENAME} \.(png|jpg|jpeg|gif|swf|eot|svg|ttf|woff|woff2|zip)$
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [L,QSA]
RewriteCond %{REQUEST_URI} \.html
RewriteRule (.*)\.html(.*) $1$2 [R=301,L]
RewriteRule .* index.php [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
</IfModule>
XML查看
<rewrite>
<!--This directive was not converted because it is not supported by IIS: RewriteBase /.-->
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url=".*" ignoreCase="false" />
<conditions>
<add input="{URL}" pattern="^/(dir1|dir2)/" ignoreCase="false" />
</conditions>
<action type="None" />
</rule>
<!--This rule was not converted because only some of the conditions are using the OR flag.-->
<rule name="Imported Rule 3" stopProcessing="true">
<match url="(.*)\.html(.*)" ignoreCase="false" />
<conditions>
<add input="{URL}" pattern="\.html" ignoreCase="false" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}{R:2}" />
</rule>
<!--The rule cannot be converted into an equivalent IIS format because of unsupported flags: E-->
一些可以幫我在這3行所給我一個錯誤?
RewriteBase /
RewriteRule .* - [L,QSA]
RewriteRule .* index.php [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
謝謝,它工作! – JakeMitchell
不客氣!請將答案標記爲已接受,將其從未答覆的問題隊列中移除(左側的複選標記)。一旦你有15 +代表,你也可以upvote你覺得有用的答案。謝謝,非常感謝。 :) – MrWhite
該網站的工作原理是頁面明智的,但現在我們無法在網站上登錄並從網站創建數據庫條目 – JakeMitchell