Old Affiliate Link Causes 404

[color=#000000]Hi,[/color]



[color=#000000]I upgraded to version 4.2.4 of cs-cart & now my affiliate links give a 404. Any url with dispatch params like this cause problems:[/color]



index.php?dispatch=aff_banners.view&bid=15&sl=EN&aff_id=4310



[color=#000000]I know the affiliate addon was discontinued that's fine. But I really need to make it so that dispatch=aff_banners.view does not return a 404, instead redirects to the home page. How would I do that?[/color]

You should add 301 redirect to the .htaccess file. Please read more about 301 redirect in this article:

[quote name='eComLabs' timestamp='1428579097' post='210819']

You should add 301 redirect to the .htaccess file. Please read more about 301 redirect in this article:



http://www.inmotionh…ct-via-htaccess

[/quote]



Thanks for your reply, but if I redirect index.php it will cause a redirect loop. I don't know how to redirect with htaccess based on url parameters or if it's even possible.

[quote name='HiSpec' timestamp='1428580789' post='210828']

Thanks for your reply, but if I redirect index.php it will cause a redirect loop. I don't know how to redirect with htaccess based on url parameters or if it's even possible.

[/quote]



You were right I was wrong you can redirect based on url param this is how it's done:



RewriteEngine on

RewriteCond %{QUERY_STRING} dispatch=aff_banners.view&bid=15&sl=EN&aff_id=4310

RewriteRule ^index.php$ /?aff=4310 [L,R=301]

Thank you for letting me know it