ペコネット

ホーム > サーバー構築 > IISでWordPressサイト

ウェブサーバー(IIS)にWordPressサイトの設置(追記事項)

Windows Server 2019のウェブサーバー(IIS)でWordPressサイトの設置内の作業変更事項

PHPのインストール

PHPのインストールは、静的HTMLサイト構築行程内のIISにPHPをインストールすると同じ手続きでインストール(公式サイトからZIPファイルをダウンロードして解凍してハンドラーマッピングのモジュールマップの追加でパスの指定を行う)する。

パーマリンクが変更できない。変更するとJSONエラー

  • ApacheにおけるRewiteモジュールが無いため。
  • Apccheにおける「.htaccess」にあたるものが無いため。

IISのRewiteモジュールのダウンロード

URL Rewrite Module 2.1

WindowsServerにインストールします。

「web.config」を配置する

「web.config」はIISにおける「.htaccess」のようなものです。なければテキストファイルを作成して以下の内容を記述します。

ファイル名「web.config」としてサイトのルートディレクトリ(ドキュメントルート)に配置します。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions><action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>