我正在对我的网站进行 URL 重写。到目前为止,它工作得很好。我得到以下代码:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /calendster/
RewriteRule ^admin2($|/) - [L]
RewriteRule ^test.php($|/) - [L]
RewriteRule ^([^/]+)/([a-z]+)/(\d+)/?$ index.php?site=$1&cmd=$2&id=$3 [L,NC,QSA]
RewriteRule ^([^/]+)/([a-z]+)/?$ index.php?site=$1&cmd=$2 [L,NC,QSA]
RewriteRule ^([^/]+)/(\d+)/?$ index.php?site=$1&id=$2 [L,QSA]
RewriteRule ^([^/]+)/?$ index.php?site=$1 [L,QSA]
使用上面显示的代码,我有这些 URL-re
test.php?site=hi --> www.domain.com/hi
test.php?site=hi&id=1 --> www.domain.com/hi/1
test.php?site=hi&cmd=test --> www.domain.com/hi/test
test.php?site=hi&cmd=test&id=1 --> www.domain.com/hi/test/1
我想要一个规则。我想
test.php?site=users&ustr=haris-skrijelj --> www.domain.com/users/haris-skrijelj
我怎样才能使这项工作?