onethink安装测试环境:

系统: CentOS Linux 7.3.1611 (Core)

Apache 2.4 2.4.25 Web服务器

PHP版本 PHP-53

数据库Mysql

以上环境下隐藏 index.php 后无法访问 File not found

Apache 2.4 2.4.25 开启了重写模块

onethink配置 URL_MODEL => 2

.htaccess 默认为onethink自带如下

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

现在访问打开网页已经影藏了index.php,但是出现了File not Find 

如果网页上加入index.php 就能访问网站。 

解决办法: 

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

替换成:

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部