SSL化に伴うhtaccessの記述方法について 動的(wordpress)静的(ベタhtml)が混在する場合編

SSL化に伴うhtaccessの記述方法について

動的(wordpress)静的(ベタhtml)が混在する場合の記述方法を紹介します。

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.ドメイン\.net
RewriteRule (.*) https://ドメイン.net/$1 [R=301,L]
ErrorDocument 404 https://ドメイン.net/

RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.php$ https://ドメイン.net/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

関連記事

  1. PHPで日付関数を使いこなす(日付条件指定)$now = date("…

  2. WordPressのユーザー権限毎の仕様

  3. 【WordPress】Advanced Custom Fields「繰…

  4. テレワークに必要な機器について

  5. アナリティクスのタグを複数設置する正しいやり方

  6. 独自ドメインをShopifyで使用、メールはXserverで利用する場…