Rewriting Url With .htaccess for Muliple Parameters

对着背影说爱祢 提交于 2019-12-11 12:49:52

问题


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]


来源:https://stackoverflow.com/questions/32088738/rewriting-url-with-htaccess-for-muliple-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!