php伪静态规则.htaccess简单规则例子

php教程11年前 (2014-08-27)16820

写个.htaccess的:rewriteengine on
RewriteBase /
RewriteRule ^index.html$ index.php
#访问路径:index.html
RewriteRule ^news.html$ news.php
#访问路径:news.html
RewriteRule ^news/(.+).html$ newsinfo.php?id=$1
#访问路径:news/2.html
RewriteRule ^products.html$ products.php
#访问路径:products.html
RewriteRule ^products/(.+).html$ pinfo.php?id=$1
#访问路径:products/2.html


RewriteRule ^index.html$ index.php [L]
RewriteRule ^list-(.+).html$ list.php?cid=$1 [L]
RewriteRule ^view-(.+).html$ view.php?niid=$1 [L]


RewriteEngine On
RewriteBase /
RewriteRule ^news_page(\d+)\.html$ /news\.php\?page=$1 [L]
#访问路径:news_page1.html
RewriteRule ^news_sortid(\d+)\.html$ /news\.php\?sortid=$1 [L]
#访问路径:news_sortid1.html
RewriteRule ^news_page(\d+)_sortid(\d+)\.html$ /news\.php\?page=$1&sortid=$2 [L]
#访问路径:news_sortid1_sortid1.html

“php伪静态规则.htaccess简单规则例子” 的相关文章

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。