简体   繁体   English

用.htaccess重写多个参数的URL

[英]Rewriting Url With .htaccess for Muliple Parameters

I Want to rewrite the url using .htaccess Plz Read the code, and you well Get to know What I mean 我想使用.htaccess Plz重写网址阅读代码,您就会了解我的意思

My URL : 我的网址:

article.php?id=1&title=example

Using this in .htaccess 在.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

所以像这样:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM