2
工作,在我的Web服务器我有一个htaccess文件看起来像这样:htaccess的不正常
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA]
所以我WebServer的所有呼叫将被重定向到index.php文件在我的根目录下有一个路径参数其中包含请求的文件。现在看看这两个电话:
domain.com/test/blub.php works -> path = test/blub.php
domain.com/test/ does not work -> path should be test
我怎样才能实现第二个电话也有效?
谢谢你这一点。工作非常好。但是现在路径参数在url中显示。我能以某种方式切断它吗? – Cilenco
现在,如果我调用domain.com/test,它不会被重定向到index.php文件 – Cilenco
对不起,您是对的。我的PHP脚本中有一个错误:/抱歉。 – Cilenco