Hello World

Just So So ...

Apache 2.2 升级到 2.4 对伪静态的影响

Apache 0 评


2018-07-04 更新

第2点:斜杠前加?,似乎又不需要,真的被搞晕了!


在 2.2 版本中没有任何问题的 .htaccess 文件:

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

在 2.4 版本中失效,需要修改的地方有如下

1、在RewriteEngine On下一行增加RewriteBase /,表示项目的根目录(作废,不增加也没影响)

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteBase

2、index.php/$1需要修改为index.php?/$1

发表评论
撰写评论