老师,请问在phpstudy里面的LoadModule rewrite_module modules/mod_rewrite.so是没有注释掉的,而根目录下的AllowOverride All也是正确的,public目录下的也是具有.htaccess文件的。重启apache之后,访问http://localhost:/index/Index/index怎么还是找不到呢??
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so #LoadModule ratelimit_module modules/mod_ratelimit.so #LoadModule reflector_module modules/mod_reflector.so #LoadModule remoteip_module modules/mod_remoteip.so #LoadModule request_module modules/mod_request.so #LoadModule reqtimeout_module modules/mod_reqtimeout.so LoadModule rewrite_module modules/mod_rewrite.so #LoadModule sed_module modules/mod_sed.so #LoadModule session_module modules/mod_session.so
DocumentRoot "D:\phpStudy\WWW\web\public" <Directory /> Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory>
如果用的phpstudy,规则如下: <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] </IfModule>
在wamp上面设置了上面的选项之后,是可以直接隐藏index.php的,但是在phpstudy就出现了问题