我想为.htaccess重写规则以获取更改网址,如下所示..
这
http://www.example.com/templates/professional_website/news.php?ac=post&id=2&p=1
要
https://www.example.com/templates/professional_website/news/post/2/1
答案 0 :(得分:0)
未经检验的答案取自随机链接的问题:
RewriteEngine on
RewriteRule ^templates/professional_website/news/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ templates/professional_website/news.php?ac=$1&id=$2&p=$3 [L,NC,QSA]
RewriteRule ^templates/professional_website/news/([^/\.]+)/([^/\.]+)/?$ templates/professional_website/news.php?ac=$1&id=$2 [L,NC,QSA]