.htaccess写法一例

htaccess写法一例

RewriteEngine on
RewriteBase /test/
RewriteRule ^test([0-9]*).html$ test.php?id=$1
RewriteRule ^new([0-9]*)/$ new.php?id=$1

实现效果:

http://localhost/test/test123.html  转化为:http://localhost/test/test.php?id=123

http://localhost/test/new123/  转化为:http://localhost/test/new.php?id=123

滚动至顶部