开发者

Help with redirect and query strings

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://do开发者_StackOverflow中文版main.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.


RewriteCond %{QUERY_STRING} ^=([^&]*)$
RewriteRule ^/?go$ hxxp://...&RD_PARM1=%1 [R,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜