www.example.com/への次のphpファイルのリクエストを非表示にします。
www.example.com/index.php to www.example.com/ (hide index.php)
www.example.com/content.php to www.example.com/ (hide content.php)
www.example.com/welcome.php to www.example.com/ (hide welcome.php)
注:リダイレクトせずにファイルを非表示にしたいだけです。たとえば、www.example.com /にリダイレクトせずに、index.phpまたはcontent.phpのパーツを非表示にします。
私は試した
RewriteEngine On
RewriteCond %{THE_REQUEST} ^\w+\ /(.*)\.php(\?.*)?\ HTTP/
RewriteRule ^ http://%{HTTP_HOST}/%1 [R=301]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule .* $0.php
私も試しました
DirectoryIndex index.php
DirectoryIndex content.php
DirectoryIndex welcome.php
これらのコードは機能していないようです。何か案が?申し訳ありませんが、私はこれに非常に新しいです。