1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

.htaccess URL正規化やリダイレクトの書き方 index.html index.phpなし

Posted at

滅多にやらない作業なので、自分用のメモとして残しておきます。

結論

.htaccessに下記コードを記述する

RewriteCond %{THE_REQUEST} ^.*/index.(html|php)
RewriteRule ^(.*)index.(html|php)$ https://%{HTTP_HOST}/$1 [R=301,L]

.htaccessファイル配置場所

.htaccessはWordPressをインストールしたディレクトリ直下(wp-adminやwp-contentディレクトリと同じ階層)に配置されています。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?