RewriteEngine On
RewriteRule index.html index.php
比如:http://www.xxx.com/index.html -> http://www.xxx.com/index.php
RewriteRule ^test([0-9]*).html$ test.php?id=$1
比如:http://www.xxx.com/test8.html -> http://www.xxx.com/test.php?id=8
RewriteRule ^cat-([0-9]+)-([0-9]+)\.html$ cat.php?id1=$1&id2=$2
比如:http://www.xxx.com/cat-1-3.html -> http://www.xxx.com/cat.php?id1=1&id2=3
RewriteRule ^cat-([a-zA-Z0-9\-]*)-([0-9]+)-([0-9]+)\.html$ cat.php?id0=$1&id1=$2&id2=$3
比如:http://www.xxx.com/cat-zbc2ac-3-5.html -> http://www.xxx.com/cat.php?id0=zbc2ac&id1=3&id2=5
RewriteRule ^cat1-([0-9]+)-([0-9]+)-([0-9]+)\.html$ cat1.php?id1=$1&id2=$2&id3=$3
比如:http://www.xxx.com/cat1-4-3-8.html -> http://www.xxx.com/cat1.php?id1=4&id2=3&id3=8
RewriteRule ^cat([0-9]*)/$ cat.php?id1=$1
比如:http://www.xxx.com/cat5/ -> http://www.xxx.com/cat.php?id1=5
RewriteRule ^catm([0-9]*)/([0-9]*)/$ catm.php?id1=$1&id2=$2
比如:http://www.xxx.com/catm6/3/ -> http://www.xxx.com/catm.php?id1=6&id2=3
.htaccess php修改url参数格式
最新推荐文章于 2024-03-19 14:19:52 发布