用.htaccess重写多个参数的URL [英] Rewriting Url With .htaccess for Muliple Parameters

查看:41
本文介绍了用.htaccess重写多个参数的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用.htaccess重写网址 请阅读代码,您就会了解我的意思

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

我的网址:

article.php?id=1&title=example

在.htaccess中使用此功能

Using this in .htaccess

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

我知道

article/1/example

我需要的是

article/example

推荐答案

是这样的:

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

这篇关于用.htaccess重写多个参数的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆