htaccess 伪静态规则


当前第2页 返回上一页

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

1

2

RewriteEngine On

RewriteRule index.html index.php

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

1

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

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

1

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

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

1

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

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

1

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

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

1

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

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

1

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

希望对大家有所帮助!

推荐教程:apache教程

以上就是htaccess 伪静态规则的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

centos系统Apache不解析php

Apache与ngin服务器区别是什么

重启docker会重启容器内的Apache

Apache不解析php7怎么办

Apache是开源的吗

Apache和nginx的比较

Apache怎么安装中间证书

怎么卸载Apache服务

Apache需要安装php吗

Apache基金会资金从哪里来

更多相关阅读请进入《Apache》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...