国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > WEB服務(wù) > 正文

Nginx中的Rewrite偽靜態(tài)法則的講解(詳細(xì))

2020-03-22 19:02:06
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
這篇文章給大家介紹的內(nèi)容是關(guān)于Nginx中的Rewrite偽靜態(tài)法則的講解(詳細(xì)),有一定的參考價(jià)值,有需要的朋友可以參考一下,希望對(duì)你有所幫助。

信賴此刻大部門用Linux VPS的伴侶都在利用這個(gè)敏捷傳布的Nginx,本日就清算一下最常見的PHP法式的Rewrite(偽靜態(tài)法則)

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 偽靜態(tài)化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 偽靜態(tài)化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;# 無(wú)分類翻頁(yè)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;# 歸檔、高級(jí)搜刮rewrite ^/(archives|search|article|links)/?$ /index.php?action=$1 last;# 全數(shù)批評(píng)、標(biāo)簽列表、引用列表 帶分頁(yè)rewrite ^/(comments|tagslist|trackbacks|article)/?([0-9]+)?/?$ /index.php?action=$1 page=$2 last;# tagsrewrite ^/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;# 自界說(shuō)鏈接rewrite ^(.*)/([0-9a-zA-Z/-/_]+)/?([0-9]+)?/?$ $1/index.php?action=show alias=$2 page=$3 last;        

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 岳阳县| 竹溪县| 芜湖市| 乐都县| 枣庄市| 广河县| 页游| 外汇| 巴南区| 丹棱县| 蒲城县| 叙永县| 锡林浩特市| 丹东市| 墨脱县| 泰和县| 沐川县| 曲麻莱县| 达尔| 扶风县| 九台市| 东源县| 凤庆县| 黄龙县| 淮滨县| 桂阳县| 康保县| 安国市| 萝北县| 清河县| 石家庄市| 奎屯市| 大方县| 石河子市| 大荔县| 韩城市| 财经| 株洲县| 庐江县| 江城| 峨山|