Rewriting Url With .htaccess for Muliple Parameter

2019-08-08 04:14发布

问题:

I Want to rewrite the url using .htaccess Plz Read the code, and you well Get to know What I mean

My URL :

article.php?id=1&title=example

Using this in .htaccess

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

I get

article/1/example

What i need is

article/example

回答1:

So something like this:

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