0

これが私のindex.phpファイルです:

<?php

echo $_SERVER['PATH_INFO'];

?>

これが私のhtaccessファイルです:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /something
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

something / index.php / helloを入力すると、結果は/ hello
になりますが、something / helloの場合、
未定義のインデックス:3行目の/Library/WebServer/Documents/xcart/index.phpのPATH_INFOと
表示されます。同じ結果が得られますか?

4

1 に答える 1

0

試す :

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^/(.*)/?$ something/$1
</IfModule>
于 2013-02-22T06:14:17.587 に答える