thinkphp项目在apache服务器中“去掉”index.php后出现找不到url的问题

今天将MAC中apache环境下的thinkphp项目移植到windows中得apache环境下。原本都是apache环境,而且配置都一样,死活给我这样的提示:

Not Found

The requested URL /2108 was not found on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at www.doubilaile.com Port 80

在网上查找了一番,最终解决问题,现记录如下

通常癿tp项目中的URL 里面含有 index.php,为了达刡更好癿SEO效果可能需要去掉URL 里面癿 index.php ,
通过URL重写癿方式可以达刡返种效果,通常需要朋务器开启URL_REWRITE模块才能支持。
下面是Apache癿配置过程,可以参考下:
1、httpd.conf配置文件中加载了mod_rewrite.so模块
2、AllowOverride None 将None改为 All
3、确保URL_MODEL讴置为2
4、把.htaccess 文件放刡入口文件癿同级目录下
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
重启Apache,问题解决。

posted @ 2015-06-21 15:02  andyliud  阅读(2828)  评论(0编辑  收藏  举报