1

PHP サイトをデバッグしようとしていますが、ルーティングの問題が発生しました。

これは特注のサイトであり、ほとんどのリクエストは index.php 経由でルーティングされます

私が抱えている問題は、ライブサーバー (Linux / Apache) では http://www.sitename.com/cart、本来あるべきように index.php を介してルーティングされることです。

しかし、私のテストサーバー(osx / apache)では 、index.phpを経由せずにhttp://www.sitename.com/cart直接行きますhttp://www.sitename.com/cart.php

.htaccess ファイル (以下) と関係があると思いますが、何が原因かわかりません。また、.htaccess ファイルは両方のサーバーで同じであるため、動作が異なる理由がわかりません。

AddType application/x-httpd-php .html
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^robots.txt$ robots_ssl.txt
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule ^([^.]+)\.s?html$ /index.php?q=$1 [L,QSA]
RewriteRule ^([^.]+)\.s?htm$ /index.php?q=$1 [L,QSA]
RewriteRule ^([^.]+)\.s?xml$ /index.php?q=$1 [L,QSA]
RewriteRule ^([^.]+)\.s?asp$ /index.php?q=$1 [L,QSA]
RewriteRule ^([^.]+)\.s?aspx$ /index.php?q=$1 [L,QSA]
RewriteRule ^robots.txt$ /index.php?q=$1 [L,QSA]
RewriteRule ^([^.]+)$ /index.php?q=$1 [L,QSA]
RewriteRule ^admin/.*$ - [PT]



#php_flag display_errors off
php_value default_charset ISO-8859-1
php_flag magic_quotes_gpc on
php_flag magic_quotes_runtime off

仮想ホスト ファイルは次のとおりです。

<VirtualHost *:80>
    DocumentRoot "/Users/jim/Sites/sitename.com/public_html"
    ServerName sitename.com
    ServerAlias www.sitename.com
        <directory "/Users/jim/Sites/sitename.com/public_html/">
           Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
           AllowOverride All
           Order allow,deny
           Allow from all
        </directory>
 </VirtualHost>
4

1 に答える 1