views:

49

answers:

1

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.

A: 
RewriteCond %{QUERY_STRING} ^=([^&]*)$
RewriteRule ^/?go$ hxxp://...&RD_PARM1=%1 [R,L]
Ignacio Vazquez-Abrams
Updated main post with progress, it sort of works but not quite as intended.
James