伪静态 URL 重写

来源:互联网 发布:mysql获取union条数 编辑:程序博客网 时间:2024/05/01 08:52

1.打开apache配置文件:


#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉
AllowOverride None 把None改为 All      //在APACHE里面去配置 (注意其他地方的AllowOverride也统统设置为ALL)
2、将以下代码另存为名称为.htaccess的文件保存在index.php入口文件平级目录下
<IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]</IfModule>
3、在tp配置文件中config.php开启URL重写模式
'URL_MODEL'=>'2',
4、重启apache


0 0
原创粉丝点击