如何去掉index.php呢
Tag: | Author: 老蒋 |
去除URL中的index.php
例如你的原路径是 http://localhost/test/index.php/index/add
那么现在的地址是 http://localhost/test/index/add
如何去掉index.php呢
1.httpd.conf配置文件中加载了mod_rewrite.so模块
2.AllowOverride None 讲None改为 All
3.确保URL_MODEL设置为2,
4 .htaccess文件必须放到跟目录下
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
Leave a comment
您必须 登录 后才能发表留言。