我與Yii框架的Apache/2.2.15(CentOS的)服務器上工作。如何從Apache/Centos中的Yii URL中刪除index.php?
下面一行取消註釋在/etc/httpd/conf/httpd.conf中
LoadModule rewrite_module modules/mod_rewrite.so
我可以看到下加載的模塊mod_rewrite的當我做foll由於
<?php phpinfo(); ?>
Yii的項目結構:
/var/www/test/
/var/www/test/index.php
/var/www/test/.htaccess
的.htaccess內容
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
它正常工作,當我做:
http://10.20.30.40/test/index.php/testcontroller/testaction
但是當我做:
http://10.20.30.40/test/testcontroller/testaction
它顯示以下錯誤:
Not Found
The requested URL /var/www/test/index.php was not found on this server.
任何想法?
'RewriteBase' ? –
@Awan你解決了這個問題嗎?我有同樣的問題,如果你已經解決了問題,請幫助我。謝謝+1 :) –