.htaccess伪静态实例记录
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
原始 php.muyangcheng.com/tag/index" data-ke-src=">php</a>.muyangcheng.com/tag/index">index.php 偽靜態(tài) index.html
RewriteRule ^index\.html$ index.php
原始 news/detail.php?id=2 ?偽靜態(tài) ?news/detail_2.html
RewriteRule ^news/detail_([0-9]{1,})\.html$ news/detail.php?id=$1
原始 index.php?cid=2&id=3 ?偽靜態(tài) 2-3.html
RewriteRule?([a-zA-Z]{1,})-([0-9]{1,})\.html$?index.php?cid=$1&id=$2
([a-zA-Z]{1,})-([0-9]{1,})\.html$是規(guī)則,index.php?action=$1&id=$2是要替換的格式,$1代表第一個(gè)括號(hào)匹配的值,$2代表第二個(gè),如此類推!!
轉(zhuǎn)載于:https://my.oschina.net/leadsir/blog/137726
總結(jié)
以上是生活随笔為你收集整理的.htaccess伪静态实例记录的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: heartbeat+drbd+mysql
- 下一篇: 使用maven编译YCSB0.1.4对c