Contents
- UNIX
- Windows
- サーバ
- プログラミング言語
- データベース
- プロトコル
- サービス
- オープンソース
- 規格・技術
- アプリケーション
- PC
- DEVICE
- その他(未分類)
お問合せ:
メールフォーム
[リライトモジュールのインストール]
IIS にリライトモジュールが入ってない場合は、まず最初にインストールします。
インスール方法は、ググればたくさんヒットします。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
上記のような Rewrite ルールを適用したい場合、Web.config に以下のように定義します。
<?xml version="1.0"?>
<configuration>
<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" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
:
</system.webServer>
</configuration>
php.ini のコメントを外して、以下を有効にします。
cgi.fix_pathinfo=1