2017-05-23 7 views
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]

答えて

0
RewriteBase/

あなたはこの行を削除し、RewriteRule置換のスラッシュの接頭辞を含めることができます。すなわち、変更し、次の行:

RewriteRule (.*)\.html(.*) $1$2 [R=301,L] 
RewriteRule .* index.php [E=REMOTE_USER:%{HTTP:Authorization},L,QSA] 

RewriteRule (.*)\.html(.*) /$1$2 [R=301,L] 
RewriteRule .* /index.php [E=REMOTE_USER:%{HTTP:Authorization},L,QSA] 

このルール

には、唯一の条件のいくつかは、ORフラグを使用しているので、変換されなかったコンバータ

コメントアウトされたコードを変換しようとしているようですか? #を開始するすべての行を削除します。

RewriteRule .* /index.php [E=REMOTE_USER:%{HTTP:Authorization},L,QSA] 

Eフラグは、環境変数を設定します。私はIISを話しませんが、上記の指示文のE=REMOTE_USER:%{HTTP:Authorization},部分を削除し、mod_setenvifを使用してください(これは変換されますか?)。たとえば、Eフラグは次のようになります。

SetEnvIf Authorization "(.*)" REMOTE_USER=$1 
+1

ありがとうございました。 – JakeMitchell

+0

あなたは大歓迎です!回答が未回答の質問欄(左のチェックマーク)から削除されていることを確認してください。一度あなたは15 +の代理店を持っているあなたはまたあなたが有用である答えをupvoteすることができます。ありがとう、非常に感謝します。 :) – MrWhite

+0

ウェブサイトのページが賢明ですが、ウェブサイトにログインしてデータベースエントリを作成することはできません – JakeMitchell