Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
しかし、たとえば、すべてのページが page.php にリダイレクトされるようにしたい:
私 -> me.php
ブログ -> blog.php
テスト -> test.php
私が望むのは、X を呼び出して X.php を開くことですが、拡張子 (.php) は表示しないため、リダイレクトが正しい言葉であるかどうかはわかりません。
みんなが私を助けてくれることを願っています。
ありがとう
ファイルを作成し、.htaccessこれを入れます:
.htaccess
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php
そうすれば、 などの URLがファイル名domain.com/blogに静かに追加.phpされます (つまり、読み込み中blog.php)。
domain.com/blog
.php
blog.php