使用 .htaccess 为多个参数重写 Url

Rewriting Url With .htaccess for Muliple Parameters

我想使用 .htaccess 重写 url 请阅读代码,你就会明白我的意思

我的 URL :

article.php?id=1&title=example

在 .htaccess 中使用它

 RewriteRule ^article/([0-9]+)/([0-9a-zA-Z_-]+)$
 article.php?id=&title= [NC,L]

我得到

article/1/example

我需要的是

article/example

所以像这样:

RewriteRule ^article/([0-9a-zA-Z_-]+)$ article.php?title= [NC,L]