- 浏览: 261973 次
- 性别:
- 来自: 海南海口
文章分类
最新评论
-
风尘之驿:
junbin007 写道61行。。莫非这是一种神奇的语法 是那 ...
PHP中批量更新数据表中多条记录 -
junbin007:
61行。。莫非这是一种神奇的语法
PHP中批量更新数据表中多条记录 -
junbin007:
39行,你懂的
PHP中批量更新数据表中多条记录 -
风尘之驿:
String line[] = new String[file ...
开启一个文本文件,一次读取其内的一行文本 -
whumartine:
String line[] = new String[file ...
开启一个文本文件,一次读取其内的一行文本
Nginx常用Rewrite伪静态法则,其中有discuz,ecshop等多个产品
信赖此刻大部门用Linux VPS的伴侣都在利用这个敏捷传布的Nginx,本日就清算一下最常见的PHP法式的Rewrite(伪静态法则)。
Wordpress:
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
PHPCMS:
location / {
###以下为PHPCMS 伪静态化rewrite法则
rewrite ^(.*)show-([0-9]+)-([0-9]+)\.html$ $1/show.php?itemid=$2&page=$3;
rewrite ^(.*)list-([0-9]+)-([0-9]+)\.html$ $1/list.php?catid=$2&page=$3;
rewrite ^(.*)show-([0-9]+)\.html$ $1/show.php?specialid=$2;
####以下为PHPWind 伪静态化rewrite法则
rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last;
}
ECSHOP:
if (!-e $request_filename)
{
rewrite "^/index\.html" /index.php last;
rewrite "^/category$" /index.php last;
rewrite "^/feed-c([0-9]+)\.xml$” /feed.php?cat=$1 last;
rewrite “^/feed-b([0-9]+)\.xml$” /feed.php?brand=$1 last;
rewrite “^/feed\.xml$” /feed.php last;
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$” /category.php?id=$1&brand=$2&page=$3 last;
rewrite “^/category-([0-9]+)-b([0-9]+)(.*)\.html$” /category.php?id=$1&brand=$2 last;
rewrite “^/category-([0-9]+)(.*)\.html$” /category.php?id=$1 last;
rewrite “^/goods-([0-9]+)(.*)\.html” /goods.php?id=$1 last;
rewrite “^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last;
rewrite “^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$” /article_cat.php?id=$1&page=$2 last;
rewrite “^/article_cat-([0-9]+)(.*)\.html$” /article_cat.php?id=$1 last;
rewrite “^/article-([0-9]+)(.*)\.html$” /article.php?id=$1 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html” /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html” /brand.php?id=$1&cat=$2&page=$3 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)(.*)\.html” /brand.php?id=$1&cat=$2 last;
rewrite “^/brand-([0-9]+)(.*)\.html” /brand.php?id=$1 last;
rewrite “^/tag-(.*)\.html” /search.php?keywords=$1 last;
rewrite “^/snatch-([0-9]+)\.html$” /snatch.php?id=$1 last;
rewrite “^/group_buy-([0-9]+)\.html$” /group_buy.php?act=view&id=$1 last;
rewrite “^/auction-([0-9]+)\.html$” /auction.php?act=view&id=$1 last;
rewrite “^/exchange-id([0-9]+)(.*)\.html$” /exchange.php?id=$1&act=view last;
rewrite “^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last;
rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$” /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last;
rewrite “^/exchange-([0-9]+)-([0-9]+)(.*)\.html$” /exchange.php?cat_id=$1&page=$2 last;
rewrite “^/exchange-([0-9]+)(.*)\.html$” /exchange.php?cat_id=$1 last;
}
SHOPEX:
location / {
if (!-e $request_filename) {
rewrite ^/(.+\.(html|xml|json|htm|php|jsp|asp|shtml))$ /index.php?$1 last;
}
}
SaBlog 2.0:
# 只带月份的归档
rewrite "^/date/([0-9]{6})/?([0-9]+)?/?$" /index.php?action=article&setdate=$1&page=$2 last;
# 无分类翻页
rewrite ^/page/([0-9]+)?/?$ /index.php?action=article&page=$1 last;
# 分类
rewrite ^/category/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&cid=$1&page=$2 last;
rewrite ^/category/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&curl=$1&page=$2 last;
# 归档、高级搜刮
rewrite ^/(archives|search|article|links)/?$ /index.php?action=$1 last;
# 全数批评、标签列表、引用列表 带分页
rewrite ^/(comments|tagslist|trackbacks|article)/?([0-9]+)?/?$ /index.php?action=$1&page=$2 last;
# tags
rewrite ^/tag/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&item=$1&page=$2 last;
# 文章
rewrite ^/archives/([0-9]+)/?([0-9]+)?/?$ /index.php?action=show&id=$1&page=$2 last;
# RSS rewrite ^/rss/([0-9]+)?/?$ /rss.php?cid=$1 last;
rewrite ^/rss/([^/]+)/?$ /rss.php?url=$1 last;
# 用户 rewrite ^/uid/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&uid=$1&page=$2 last;
rewrite ^/user/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&user=$1&page=$2 last;
# 舆图文件
rewrite sitemap.xml sitemap.php last;
# 自界说链接
rewrite ^(.*)/([0-9a-zA-Z\-\_]+)/?([0-9]+)?/?$ $1/index.php?action=show&alias=$2&page=$3 last;
Discuz 7:
rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;
rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page\%3D$3&page=$2 last;
rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;
rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;
Typecho:
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
4.8.5 shopex 启用伪静态
……
location /
{
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$1 last;
}
}
……
1. 启用伪静态
……
##begin add by guozhenbin 20100727 (use Pseudo-static)
location /
{
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$1 last;
}
}
##end add by guozhenbin 20100727
……
发表评论
-
php缓存技术教程 PHP中9大缓存技术总结
2017-03-11 23:19 0偶尔在网上见到这样一篇总结php缓存的文章,这里给大家分享 ... -
php中获取文件file_a相对于文件file_b的目录
2013-07-25 14:37 814/** * @desc 获取文件file_a ... -
隐藏手机号码的中间部分,只显示前后两位数字
2013-07-11 09:52 1636/** * 隐藏手机 * @ ... -
安全的反序列化,对带有双引号的内容进行发序列化,例如:编辑器
2013-07-08 10:29 1015/** * 安全的反序列化 * * @au ... -
在Windows下安装pear之后安装PHPUnit
2013-05-29 10:28 925Windows 下安装pear,修 ... -
PHP通过图片文件头信息来识别图片的类型【扩展名】
2013-05-29 10:26 1747$file = @fopen('包含路 ... -
PHP检查上传的图片并返回图片的真正类型【扩展名】
2013-05-29 10:25 1136$file = @fopen('包含路径的文件名', ... -
PHP中批量更新数据表中多条记录
2013-05-27 18:51 1911以下代码是PHP代码,由于出现错乱,所以借用java显示 ... -
PHP中批量插入多条记录到数据表
2013-05-27 18:05 1647class test { /** ... -
PHP中根据输入的周数获取到该周的日期范围
2013-03-15 11:29 918/** * 根据输入的周数获取到该周的日期 ... -
设置apache网站的虚拟目录
2013-03-03 14:56 583NameVirtualHost *:80 & ... -
php中生成商城订单流水号
2013-01-25 10:04 2044/** * 生成订单流水号 ... -
php中将多维数组按键名进行排序,类似数据库的字段排序
2013-01-24 20:13 897//需要排序的数组,可以按多个键名排序 $arra ... -
php中怎样在二维数组里查找一维数组是否存在
2013-01-24 20:06 1463方法一:利用array里的内置函数【推荐使用】 //子数组 ... -
在PHP中让cookie及时生效,不需要再次刷新页面
2012-12-28 13:56 1132PHP的COOKIE第一次只是创建了这个COOKIE,再 ... -
用PHP来模拟实现shell脚本(模拟计划定时任务)
2012-12-28 13:53 826ignore_user_abort();//即使Clie ... -
用js进行url编码后用php反解以及用php实现js的escape功能函数总结
2012-12-17 20:14 807解决办法: 采用js对URL中的汉字进行escape编码。 & ... -
在字符串中查找指定字符连续一起最长的子字符串
2012-12-06 15:12 849$a = '0100000011010111 ... -
PHP中最简单的excel导出程序
2012-12-06 15:08 767这里的文件编码是utf-8 header ... -
mysql连接数据库的基本类文件
2012-11-03 12:00 879/* * Created on 2010-10-2 ...
相关推荐
Nginx常用Rewrite伪静态法则 信赖此刻大部门用Linux VPS的伴侣都在利用这个敏捷传布的Nginx,本日就清算一下最常见的PHP法式的Rewrite(伪静态法则)。 Wordpress: location / { index index.html index.php; if ...
NGINX1.8泛解析伪静态完整文件,把后缀txt改成conf,其实我想大家看的就是泛域名部分了,因为实在没积分下载资源了,所以定了5分,请见谅。
蚂蚁伪静态nginx
discuz X3 伪静态文件 http.ini
mayicms蚂蚁分类信息5.9伪静态规则
phpcms在nginx的rewrite伪静态写法,网上是乱七八糟的不知道有多少种。有的是直接从apache的规则修改来的,但这种修改而来的却不是最标准的
nginx作服务Discuz伪静态规则,将PHP伪装成HTML,优化搜索。
让thinkphp3.1.3支持php7及nginx支持伪静态
nginx里使用伪静态是直接在nginx.conf 中写规则的,并不需要像apache要开启写模块(mod_rewrite)才能进行伪静态。 nginx只需要打开nginx.conf配置文件,在server里面写需要的规则即可。 代码如下:server { listen ...
本文是关于 nginx rewrite常用示例。
nginx设置伪静态。 用于隐藏.php后缀,在url后补斜杠/
nginx rewrite 伪静态配置参数和使用例子 附正则使用说明
nginx 伪静态 重定向
直接把文件复制到 nginx文件夹下面 ngnix.conf里面改下你xxx.com.conf的名称和xxx.com.conf的名称
但很多网友还是不太了解Nginx服务器的伪静态规则的,而如果你安装的是一些常用的程序,如WordPress,PHPCMS,ECSHOP,SHOPEX,Discuz 7,那伪静态规则就有现成的了。为方便各位站长,收集了这几个常用程序的伪静态...
nginx支持.htaccess伪静态rewrite的方法.docx
本篇文档详细记录了Nginx和Apache伪静态设置的规则,作为线上维护的参考手册,在此分享,希望能帮助到有用到的朋友。
nginx下伪静态配置参数详细说明,使用nginx的朋友,nginx rewrite 伪静态配置参数和使用例子 附正则使用说明
宝塔linux Nginx环境WeCenter伪静态规则代码.docx