分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

thinkphp3.2----实现伪静态和路由配置

发布时间:2023-09-06 01:17责任编辑:沈小雨关键词:thinkphp配置

URL模式:

0.普通   http://localhost/qixin/ThinkCMF(test)_backup/index.php?g=user&m=login&a=index    带有?号这种传参路径,对SEO不友好

1.pathinfo   http://localhost/qixin/ThinkCMF(test)_backup/index.php/user/login/index

2.rewrite    http://localhost/qixin/ThinkCMF(test)_backup/user/login/index.html          已经去除掉index.php,要开启Apache rewrite moudle,建立.htaccess文件

在config中配置

‘URL_ROUTER_ON‘ ??=> true, ?????// 开启路由‘URL_MODEL‘=>2, //URL模式‘URL_ROUTE_RULES‘=>array(    //‘路由表达式‘ => ‘路由地址和传入参数‘ ???????‘product‘=>‘Index/Index/product‘, ???????‘articleList‘=>‘Index/Article/articleList‘, ???????‘/^articleList_cat_id_(\d+)$/‘=>‘Index/Article/articleList?cat_id=:1‘, ???????‘/^article_id_(\d+)$/‘=>‘Index/Article/detail?article_id=:1‘,
     ‘upload_face$‘ => ‘user/profile/upload_face‘,       //规则路由 ?http://localhost/qixin/ThinkCMF(test)_backup/upload_face.html
     ‘/^upload_face_(\d+)$/‘ => ‘user/profile/upload_face‘  //正则路由 ?http://localhost/qixin/ThinkCMF(test)_backup/upload_face_1.html ???),‘URL_HTML_SUFFIX‘ ??????=> ?‘html‘, ?// URL伪静态后缀设置

thinkphp3.2----实现伪静态和路由配置

原文地址:http://www.cnblogs.com/qiuphp/p/7657192.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved