apache RewriteRule不在服务器上工作,但在本地xampp上工作


apache RewriteRule not working on server but works on local xampp

我对apache的重写规则有问题。这个url不能在服务器上工作,但可以在我的xampp上工作:

http://www.kajak-zveza.si/moduli/novice/jure-meglic-mora-ponovno-pod-noz

my rewrite rule

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^moduli/([^/]+)/(.*)$ moduli/$1/index.php/$2 [L]

但这是有效的:

http://www.kajak-zveza.si/moduli/novice/index.php/jure-meglic-mora-ponovno-pod-noz

为什么?什么是错误的工作在xampp,但不与PHP 5.3.8服务器

确保在Apache配置文件中有

<Directory /path/to/your/site/dir>
AllowOverride All
</Directory>
#RewriteLog "/var/log/apache2/rewrite.log"
#RewriteLogLevel 3

然后tail -f /var/log/apache2/rewrite.log文件。当您发出失败的请求时,请仔细查看此文件,以及Apache错误日志。

然后,当问题解决后,确保您在上面的Directory指令中使用了正确的权限。