帮助重定向和查询字符串

发布于 2024-08-31 20:53:15 字数 1093 浏览 0 评论 0原文

我在 mod 重写方面完全是新手,所以我会尝试尽可能清楚地提出我的问题:

我正在尝试创建以下(静态)附属网址的网址重定向,该网址可以将其自身附加到之后的任何产品链接中使用查询字符串:

附属网址: hxxp://clk.affilite.com/fs-bin/click?id=aFb*BBBBBpQ&subid=&offerid=9999.2&type=5&tmpid=9999&RD_PARM1=

产品网址: hxxp:// example.domain.com

我想要实现的是重定向联属代码,如下所示,并能够在之后添加动态产品网址,如下例所示:

重写联属网址: hxxp://domain.com/go

附属网址 + 产品网址: hxxp://domain.com/go?=http://example.domain.com

重定向到: hxxp://clk.affilite.com/fs-bin/click?id=aFb*BBBBBpQ&subid=&offerid=9999.2&type=5&tmpid=9999&RD_PARM1=http://example.domain.com


编辑:

好的,开始使用以下建议到达某处,如下所示:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^=([^&]*)$
RewriteRule ^/?yo$ hxxp://google.com%1 [R,L]

访问: hxxp://domain.com/yo?=hxxp://product.com

输出: hxxp://www.google.comhxxp//product.com?=hxxp://product.com

它将产品网址保留在重定向网址的末尾,如果网址后面有其他 = 符号,它还会给出 404有哪些。

I'm a total novice at mod rewrite so I'll try and present my question as clearly as possible:

I'm trying to create a url redirect of the following (static) affiliate url that can append it self to any product links after using a query string:

affiliate url:
hxxp://clk.affilite.com/fs-bin/click?id=aFb*BBBBBpQ&subid=&offerid=9999.2&type=5&tmpid=9999&RD_PARM1=

product url:
hxxp:// example.domain.com

What I want to achieve is redirecting the affiliate code as below and being able to add dynamic product urls after as the following examples show:

rewritten affiliate url:
hxxp://domain.com/go

affiliate url + product url:
hxxp://domain.com/go?=http://example.domain.com

redirects to:
hxxp://clk.affilite.com/fs-bin/click?id=aFb*BBBBBpQ&subid=&offerid=9999.2&type=5&tmpid=9999&RD_PARM1=http://example.domain.com


EDIT:

Ok starting to get somewhere using the below suggestion as follows:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^=([^&]*)$
RewriteRule ^/?yo$ hxxp://google.com%1 [R,L]

Visiting:
hxxp://domain.com/yo?=hxxp://product.com

Outputs:
hxxp://www.google.comhxxp//product.com?=hxxp://product.com

it keeps the product url at the end of the redirected url it also gives a 404 if there are additional = symbols later in the url which there are.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑着哭最痛 2024-09-07 20:53:15
RewriteCond %{QUERY_STRING} ^=([^&]*)$
RewriteRule ^/?go$ hxxp://...&RD_PARM1=%1 [R,L]
RewriteCond %{QUERY_STRING} ^=([^&]*)$
RewriteRule ^/?go$ hxxp://...&RD_PARM1=%1 [R,L]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文