私は、.php を追加しなくてもスクリプトを実行する傾向があるサーバーで作業しています。つまり、私のページが activities.php であるとしましょう。次のコマンドでスクリプトを実行できます。
www.example.com/activities.php
www.example.com/activities
and even www.example.com/activities/
私は次のような問題を回避しようとしました:
if ($_SERVER['REQUEST_URI'] != $_SERVER['SCRIPT_NAME']) header('Location: '. $_SERVER['SCRIPT_NAME']);
いくつかのデータを投稿する必要があるまでは、うまく機能します。私のhtaccessファイルには、この動作を説明するものは何もありません(mod_rewriteなどはありません)。どうすればこれをオフにできますか?
サーバー情報:
Linux Linux1 3.2.0-24-generic #39-Ubuntu SMP Mon May 21 16:52:17 UTC 2012 x86_64
Apache Version Apache/2.2.22 (Ubuntu)
Apache API Version 20051115
前もって感謝します
編集: .htaccess ファイル
php_flag display_errors on
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_Host} ^domain.be [NC]
RewriteRule ^(.*)$ http://www.domain.be/$1 [L,R=301]