thinkphp3.2----实现伪静态和路由配置
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----实现伪静态和路由配置的更多相关文章
- mvc2/3/4_伪静态_路由配置
一.路由规则: routes.MapRoute( name: "Default2", url: "{contr ...
- MVC 伪静态路由、MVC路由配置,实现伪静态。
前段时间,研究了一下mvc路由配置伪静态,在网上扒了很多最后还是行不通,所以我现在把这些心得整理出来,供大家分享: 1.mvc中默认路由配置是:http://localhost:24409/Home/ ...
- mvc路由配置.html结尾的伪静态
mvc 标准的写法 通常是(http://localhost:8149/Home/Index) 路由配置如下: 有时候需求 如 http://localhost:8149/Home/Index 改为h ...
- 一、虚拟环境.二、路由配置主页与404.三、2.x路由分发.四、伪静态.五、request对象.六、FBV与CBV.七、文件上传.
一.虚拟环境 ''' 解决版本共存 1. 用pycharm选择File点击NewProject然后选择virtualenv创建一个纯净环境 2. 打开下载的目录将venv文件夹下的所有文件(纯净的环境 ...
- IIS7 伪静态 web.config 配置方法【详解】
IIS7 做伪静态比较的简单方便 1.程序方面 只需要设置web.config 就可以了. 2.服务器需要安装:URL Rewrite 下载地址:http://www.iis.net/download ...
- .NetCore MVC中的路由(1)路由配置基础
.NetCore MVC中的路由(1)路由配置基础 0x00 路由在MVC中起到的作用 前段时间一直忙于别的事情,终于搞定了继续学习.NetCore.这次学习的主题是MVC中的路由.路由是所有MVC框 ...
- ASP.NET WebForms MapPageRoute 路由配置
MapPageRoute 应该是 ASP.NET 4.0 中的东西,但现在我是第一次使用它,使用场景是:MVC 混合使用 WebForm,然后对 WebForm 进行路由配置,当然也可以使用 ISAP ...
- MVC路由配置
目录 URL Routing 的定义方式 示例准备 给片段变量定义默认值 定义静态片段 自定义片段变量 自定义片段变量的定义和取值 将自定义片段变量作为Action方法的参数 指定自定义片段变量为可选 ...
- ui-router带参数的路由配置
ui-router带参数的路由配置 使用ng-route的时候带参数的连接这样配置: $routeProvider.when('item/itemid/:itemid', { templateUrl: ...
随机推荐
- distributed lock manager (DLM)(分布式管理锁)
A distributed lock manager (DLM) provides distributed software applications with a means to synchron ...
- ajax+servlet 简易时间效果
<!DOCTYPE html> <html> <head> <title>index.html</title> <meta name= ...
- nhibernate GetType
本原理 /* This code assumes an IEntity interface that identifies your persistent types. */ /// <summ ...
- Linux-shell-算术运算{expr、bc、dc、(( ))和[ ]}
Linux-shell-算术运算{expr.bc.dc.(( ))和[ ]} 摘自: https://www.cnblogs.com/snowsolf/p/3325235.html 在Linux下做算 ...
- ACM暑假培训宣讲稿
(鞠躬)感谢大家的掌声! 我上台来作这次的宣讲,首先要感谢大家的捧场(当然,这是一句玩笑话),其实吧,我要感谢一下我们ACM班老大(班长),hjh队友,是他指派我来的,给了我这个宝贵的机会.最要感谢的 ...
- [GO]方法集
指针变量的方法集 package main import "fmt" type Person struct { name string sex byte age int } fun ...
- GitLab服务器IP地址修改
gitlab安装介绍:https://about.gitlab.com/downloads/#centos7 刚搭建好的gitlab在GitLab上新建一个项目test_gitlab,刚开始仓库地址是 ...
- Error creating bean with name 'as' defined in class path resource
(1)一个是setter方法的名字和配置文件对应名字有问题 (2)导入的包不对,搭建环境出错.
- python切片、列表解析、元组
1.列表解析 test = [x**2 for x in range(1,11)] 2.切片 test1 = ["a","b","c",&q ...
- Exception (3) Java exception handling best practices
List Never swallow the exception in catch block Declare the specific checked exceptions that your me ...