XSERVER、index.html、index.phpをなしに統一する方法は #ナイショ。

index.html、index.phpをなしに統一する方法

「.htaccess」に以下を追加

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

例は、sainoitnote.com/index.htmlをsainoitnote.com/に統一
例は、sainoitnote.com/index.phpをsainoitnote.com/に統一

XSERVERでは、「Options +FollowSymLinks」は、不要

Xserver

以上

 


関連記事
XSERVER、wwwをなしに統一する方法は #ナイショ。 XSERVER、「http://~」へのアクセスを自動的に「https://~」へ転送する方法