我正在尝试从 URL 中删除 index.php:
这行得通
http://server/bw/index.php/test
这不起作用
http://server/bw/test
我尝试更改 .htaccess 并在网上观看,我发现它应该是这样的:
RewriteEngine On
RewriteBase /bw/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
我尝试以这种方式编辑它:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
或以这种方式:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /bw/index.php [QSA,L]
或以这种方式:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
但是当我尝试访问http://server/bw/test
它时,我说:
Not Found
The requested URL /bw/test was not found on this server.
Apache/2.2.15 (CentOS) Server at server Port 80
我检查了我的内部httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so
是否启用..我现在不知道该怎么办..
我该如何解决?请帮我!