2017-07-04 13 views
1

私のアプリケーションでpretty urlを使いたいです。私はYiiの1.1(PHPフレームワーク)とIIS 7.5pretty url iisを設定する7.5

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
<system.webServer> 

<directoryBrowse enabled="false" /> 

    <rewrite> 
     <rules> 
     <rule name="Hide Yii Index" stopProcessing="true"> 
      <match url="." ignoreCase="false" /> 
      <conditions> 
      <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> 
      </conditions> 
       <action type="Rewrite" url="index.php" appendQueryString="true" /> 
     </rule> 
     </rules> 
    </rewrite> 

</system.webServer> 
</configuration> 

私はこのような私のIISの書き換えルールを設定する必要がありを使用しています。しかし、仕事ではありません。なぜ誰かが知っていますか?

答えて

0

私はあなたがweb.configファイル

<serverVariables> 
     <set name="REQUEST_URI" value="{UNENCODED_URL}" replace="true" /> 
</serverVariables> 

と結果のコードの下に挿入すると思います

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 

    <configSections> 
     <sectionGroup name="system.webServer"> 
      <sectionGroup name="rewrite"> 
       <section name="rewriteMaps" overrideModeDefault="Allow" /> 
       <section name="rules" overrideModeDefault="Allow" /> 
      </sectionGroup> 
     </sectionGroup> 
    </configSections> 

    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="Imported Rule 1" stopProcessing="true"> 
        <match url="^(.*)$" ignoreCase="false" /> 
        <conditions> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="index.php" /> 
       </rule> 
      </rules> 
     </rewrite> 

    </system.webServer> 
</configuration> 
0

をお試しください:この問題は、ペルシャ語やアラビア語 で主に発生し

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="WordPress Rule" stopProcessing="true"> 
        <match url=".*" /> 
        <conditions> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="index.php" /> 
        <serverVariables> 
         <set name="REQUEST_URI" value="{UNENCODED_URL}" replace="true" /> 
        </serverVariables> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 

とほとんどのワードプレスのウェブサイトで使用

関連する問題