如何使用.htaccess重写带有两个变量的url [英] how to rewrite a url with two variables using .htaccess

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

问题描述

我想用.htaccess重写它,我有这个网址:

i want rewrite it with a .htaccess i have this url:

../index.php?page=details&id=123456

像这样:

../detail/123456

但我不是真的知道该怎么做。您能帮我重写此网址吗?
或给我一个简单的示例,我可以理解它的工作原理

but I do not really know how to do this. Could you help me to rewrite this url? or give me a simple example that I can understand how it works

推荐答案

这应该有效:

RewriteEngine On
RewriteRule ^detail/([^/]*)$ /index.php?page=details&id=$1 [L]

这篇关于如何使用.htaccess重写带有两个变量的url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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