求教各位亲了,帮个忙:
希望:我现在遇到如下问题,使用thinkphp框架,希望能够隐掉index.php;
已经操作过的:
1. LoadModule rewrite_module modules/mod_rewrite.so 已经去掉#,打开了
2. 也设置了
Options All
AllowOverride all
Order allow,deny
Allow from all
Require all granted
3.网站、thinkphp和php程序文件是从阿里云服务器下载的,在服务器上很正常,不过云上是linux+nginx,我这是windows下phpstudy(apcahe)。
4.htaccess文件配置是云服务上的,也是默认的
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
现在状态:首页:localhost可以打开,隐藏掉了index.php,首页在home目录下
子页面省略index.php无法显示,不省略显示正常。
例如:localhost/index.php/gur是正常的
localhost/gur 会显示Not Found
请问这是什么情况,应该怎么设置啊
.htaccess重写规则支队apache生效,nginx需修改nginx配置文件:
location / {
include /var/www/.rewrite;
}
包含.rewrite文件,rewrite文件内容如下:
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1;
rewrite ^/Jact_robfaty/(.*)$ /Jact_robfaty/index.php/$1;
}