.htaccess中 - 混淆干净网址干净、网址、htaccess

2023-09-02 00:39:25 作者:想念常常挥霍

如果我想简单地重定向 /客户/页/ /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]