WordPress里的所有url rewrite规则清单
WordPress里主要的页面结构分为“文章(post)”、“页面(page)”、分类目录、标签(tag)等,最主要的我们会看到这几种,通常我们关系的wordpress里了url rewrite规则也是跟这几个相关。但其实Wordpress里还有很多我们平时没有主要到的url rewrite规则。
就在上一篇《修改WordPress里页面(page)的固定链接结构的方法》,我注意到了Wordpress里的WP Rewrite这个对象。WP Rewrite是Wordpress里负责url rewrite的对象,这个对象里含有一个数组:$wp_rewrite->rules
,它里面存储了所有Wordpress里需要处理的url rewrite规则,下面是这个数组的结构:
Array
([cat/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2][cat/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2][cat/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2][cat/(.+?)/?$] => index.php?category_name=$matches[1][post/tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2][post/tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2][post/tag/([^/]+)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2][post/tag/([^/]+)/?$] => index.php?tag=$matches[1][post/type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2][post/type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?post_format=$matches[1]&feed=$matches[2][post/type/([^/]+)/page/?([0-9]{1,})/?$] => index.php?post_format=$matches[1]&paged=$matches[2][post/type/([^/]+)/?$] => index.php?post_format=$matches[1][.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$] => index.php?feed=old[.*wp-app\.php(/.*)?$] => index.php?error=403[.*wp-register.php$] => index.php?register=true[feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1][(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1][page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1][comments/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1[comments/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1[search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?s=$matches[1]&feed=$matches[2][search/(.+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?s=$matches[1]&feed=$matches[2][search/(.+)/page/?([0-9]{1,})/?$] => index.php?s=$matches[1]&paged=$matches[2][search/(.+)/?$] => index.php?s=$matches[1][post/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2][post/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2][post/author/([^/]+)/page/?([0-9]{1,})/?$] => index.php?author_name=$matches[1]&paged=$matches[2][post/author/([^/]+)/?$] => index.php?author_name=$matches[1][post/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4][post/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4][post/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4][post/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3][post/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3][post/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3][post/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3][post/([0-9]{4})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2][post/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2][post/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2][post/([0-9]{4})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&paged=$matches[2][post/([0-9]{4})/?$] => index.php?year=$matches[1][post/.?.+?.html/attachment/([^/]+)/?$] => index.php?attachment=$matches[1][post/.?.+?.html/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1[post/.?.+?.html/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2][post/.?.+?.html/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2][post/.?.+?.html/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2][post/(.?.+?).html/trackback/?$] => index.php?pagename=$matches[1]&tb=1[post/(.?.+?).html/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2][post/(.?.+?).html/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2][post/(.?.+?).html/page/?([0-9]{1,})/?$] => index.php?pagename=$matches[1]&paged=$matches[2][post/(.?.+?).html/comment-page-([0-9]{1,})/?$] => index.php?pagename=$matches[1]&cpage=$matches[2][post/(.?.+?).html(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2][post/[^/]+.html/attachment/([^/]+)/?$] => index.php?attachment=$matches[1][post/[^/]+.html/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1[post/[^/]+.html/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2][post/[^/]+.html/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2][post/[^/]+.html/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2][post/([^/]+).html/trackback/?$] => index.php?name=$matches[1]&tb=1[post/([^/]+).html/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?name=$matches[1]&feed=$matches[2][post/([^/]+).html/(feed|rdf|rss|rss2|atom)/?$] => index.php?name=$matches[1]&feed=$matches[2][post/([^/]+).html/page/?([0-9]{1,})/?$] => index.php?name=$matches[1]&paged=$matches[2][post/([^/]+).html/comment-page-([0-9]{1,})/?$] => index.php?name=$matches[1]&cpage=$matches[2][post/([^/]+).html(/[0-9]+)?/?$] => index.php?name=$matches[1]&page=$matches[2][post/[^/]+.html/([^/]+)/?$] => index.php?attachment=$matches[1][post/[^/]+.html/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1[post/[^/]+.html/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2][post/[^/]+.html/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2][post/[^/]+.html/([^/]+)/comment-page-([0-9]{1,})/?$] => index.php?attachment=$matches[1]&cpage=$matches[2]
)
从这个数组里可以看出,Wordpress里总共大概有60多种rul rewrite规则,这些规则分的很细,每一种对应了一种特征页面。
WordPress里的所有url rewrite规则清单相关推荐
- magento url rewrite规则
magento运行需要php开启php_curl.dll模块.url rewrite规则对应表:Code Call Valuebase Mage::getBaseDir()Mage::getBaseD ...
- Apache Rewrite规则详解[转]
1.Rewrite规则简介:Rewirte主要的功能就是实现URL的跳转,它的正则表达式是基于Perl语言.可基于服务器级的(httpd.conf)和目录级的(.htaccess)两种方式.如果要想用 ...
- Apache Rewrite 规则详解
在开篇之前: 我想说这篇文章其实是我刚刚接触Rewrite的时候学习的文档,应属转载,但是在这里我不想写明原地址,原因是文章中大多数给出的配置命令经实验都是错误的.需要原文的可以在谷歌上搜索一下&qu ...
- nginx的url重写[rewrite规则和参考]
本日志内容来自互联网和平日使用经验,整理一下方便日后参考. Nginx Rewrite 相关指令有 if.rewrite.set.return 等. if 的语法 应用于 server 和 locat ...
- nginx rewrite规则语法
在新主机的迁移过程中,最大的困难就是WP permalink rewrite的设置. 因为旧主机是用的Apache, 使用的是WP本身就可以更改的.htaccess,没有太大的难度.而这次在VPS上跑 ...
- nginx rewrite规则语法(关于break和last分析得很好)
在新主机的迁移过程中,最大的困难就是WP permalink rewrite的设置. 因为旧主机是用的Apache, 使用的是WP本身就可以更改的.htaccess,没有太大的难度.而这次在VPS上跑 ...
- ginx rewrite规则语法
1 Nginx rewrite基本语法 Nginx的rewrite语法其实很简单.用到的指令无非是这几个 set if return break rewrite 麻雀虽小,可御可萝五脏俱全.只是简单的 ...
- 在ASP.NET MVC中使用IIS级别的URL Rewrite
在ASP.NET MVC中使用IIS级别的URL Rewrite 原文 在ASP.NET MVC中使用IIS级别的URL Rewrite 大约一年半前,我在博客上写过一系列关于URL Rewrite的 ...
- nginx配置location总结及rewrite规则写法
原文连接:http://seanlook.com/2015/05/17/nginx-location-rewrite/ 1. location正则写法 一个示例: 1 2 3 4 5 6 7 8 9 ...
最新文章
- PHPUnit单元测试 - 我看过的PHP开源框架
- WIn32中CInternetSession运行异常(afxCurrentAppName 为空)
- 嵌入式linux的学习笔记-共享内存(六)
- linux 串口格式化输出字符串,如何把电压这个浮点值转字符串输出到串口
- Devpress.XtraGrid.GridControl.GridView属性
- Flink-org.apache.flink.streaming.api.windowing.windows.Window
- matlab——knnsearch用法介绍
- Android Widevine 基本概念
- 菜鸟shell脚本教程读后感
- 解决 iOS 13 定位权限弹框自动消失
- 这个数据库神器真是太diao了
- html在抽奖图片自动效果图,jQuery实现图片随机切换、抽奖功能(实例代码)
- X Server移植指导之三 输出层移植 (XServer Porting Guide)
- 爬取网易云音乐评论过万歌曲
- Nature:Deep Learning 深度学习综述
- MATLAB差影法的人体姿态识别
- 绿联扩展坞拆解_用过才知道,华为P30搭配绿联扩展坞可实现众多有趣玩法
- 下水盖为什么是圆的?
- k8s部署-31-k8s中如何进行资源隔离资源
- 单相整流及三相整流电路分析-包括整流桥及电容选择计算
热门文章
- 基于Centos7系统搭建Redis集群之主从复制(新手教程)
- [20110209]Cocos2dSimpleGame入门系列《如何用cocos2d-x来开发简单的Uphone游戏》学习小记
- 2024东南大学计算机考研信息汇总
- 认证和授权有什么区别?
- mysql count 返回值_COUNT(*)总是返回结果吗?
- linux拨号成功无法上网,linux拨号上网有什么解决方法
- 集体涨价出现多米诺骨牌效应?
- sql 四舍五入后补零
- 计算机无法拔出gtx950,玩游戏提示弹出GTX950M时出问题?驱动人生帮你解决问题...
- led户外全彩显示屏有哪几种型号?户外显示屏的价格是多少