RewriteRule-htaccess伪静态规则写法和常用规则

admin CMS教程评论20阅读模式
1
RewriteRule index.html index.php

比如:http://www.wdzzz.com/index.html  -> http://www.wdzzz.com/index.php

1
RewriteRule ^test([0-9]*).html$ test.php?id=$1

比如:http://www.wdzzz.com/test8.html  -> http://www.wdzzz.com/test.php?id=8

1
RewriteRule ^cat-([0-9]+)-([0-9]+)\.html$ cat.php?id1=$1&id2=$2

比如:http://www.wdzzz.com/cat-1-3.html -> http://www.wdzzz.com/cat.php?id1=1&id2=3

1
RewriteRule ^cat-([a-zA-Z0-9\-]*)-([0-9]+)-([0-9]+)\.html$ cat.php?id0=$1&id1=$2&id2=$3

比如:http://www.wdzzz.com/cat-zbc2ac-3-5.html -> http://www.wdzzz.com/cat.php?id0=zbc2ac&id1=3&id2=5

1
RewriteRule ^cat1-([0-9]+)-([0-9]+)-([0-9]+)\.html$ cat1.php?id1=$1&id2=$2&id3=$3

比如:http://www.wdzzz.com/cat1-4-3-8.html -> http://www.wdzzz.com/cat1.php?id1=4&id2=3&id3=8

1
RewriteRule ^cat([0-9]*)/$ cat.php?id1=$1

比如:http://www.wdzzz.com/cat5/ -> http://www.wdzzz.com/cat.php?id1=5

1
RewriteRule ^catm([0-9]*)/([0-9]*)/$ catm.php?id1=$1&id2=$2

比如:http://www.wdzzz.com/catm6/3/ -> http://www.wdzzz.com/catm.php?id1=6&id2=3

文章声明:
1、本站文章来源于互联网,仅供学习交流参考使用,严禁用于商业用途,因此造成的一切法律后果自行承担。
2、本站不对文章内容的完整性和安全性负责,请自行辨别,如发现有问题,请及时联系我们进行处理。
3、如果你有比较好的文章需要发布,可以联系站长屋VPS小编,或者自行点击 投稿。
4、若文章中有侵权或不适当内容,请告知我们,本站会第一时间进行处理。 免责申明。
admin
  • 我们不提供免费技术支持,本文属于用户投稿。
  • 转载请务必保留本文链接:https://www.zzwvps.com/1819.html

发表评论