本文介绍了.htaccess中 - 混淆干净网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我想简单地重定向 /客户/页/
到 /clients.php?view=page
我会用一些简单的这一点,它的伟大工程。
If i wanted to simply redirect /clients/page/
to /clients.php?view=page
i would use something as simple as this, it works great.
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^clients/([^/]+) /clients.php?section=$1&$2 [NC]
如果我有,例如,一个网址,如: /客户/页/名称=汤姆我怎么能这些HTTP GET变量转移到一个简单的URL如 /clients.php?view=page&name=Tom
我曾尝试和失败。
If i had for example, a url like: /clients/page/?name=Tom
how could i transfer those HTTP GET variables to a simple url like /clients.php?view=page&name=Tom
i have tried and failed.
任何想法?
推荐答案
我想你可以使用[QSA]标志,它代表查询字符串追加。这意味着您可以轻松地添加变量的查询字符串:
I think you can use the [QSA] flag, which stands for Query String Append. This means that you can add variables to the Query String easily:
RewriteRule ^clients/([^/]+) /clients.php?section=$1 [QSA, NC]
这篇关于.htaccess中 - 混淆干净网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!