我有一个xampp本地网站,我想将此网址localhost/mysite/frontend/article.php?article_id=something
转换为localhost/mysite/frontend/article_id/something
。我使用此重写规则
RewriteRule ^([A-Za-z0-9-]+)/?$ article.php?article_id=$1 [L]
但是不对。有人可以帮忙。谢谢。
答案 0 :(得分:0)
对于http:// localhost / mysite / frontend / article_id /如果.htaccess在mysite目录中并忽略某些内容
RewriteRule ^frontend/([^/]+)/ /mysite/frontend/article.php?article_id=$1 [L]
答案 1 :(得分:0)
试试这个:
RewriteBase /mysite/frontend/
RewriteRule ^([A-Za-z0-9-]+)(/(.*?))?/?$ article.php?$1=$3 [L]