I have a 3rd party who passes traffic to my website.
Sometimes they use a string in their url like:
https://referrer.com/embed/section.htm?bikes=1
If the referrer passes traffic to me with the argument bikes=1 I'd like to serve up a different page.
How can I do this (I know this question has been done to death but I can't see an example that matches my question.)
EDIT
I've tried editting .htaccess with the following but it breaks access to the entire site (with a 500 error)
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^(.*)\.referrer\.(.*)\(*bikes*) [NC]
RewriteRule ^(.*)$ https://www.my-site.com/bikes [L,R]
Another Edit!
Here's an example of an access.log entry where the 3rd party is posting to my site:
90.xxx.xxx.xxx- - [21/Oct/2019:15:03:51 +0000] "POST /products HTTP/1.1" 200 23505 "https://referrer.com/embed/products.htm?bikes=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
So, they're POSTing to my /products page. I want to redirect this to /bikes retaining the POST data (using 307 as suggested by @DeanTaylor
I've tested this out using some mod_rewrite testing tools but can't get the correct syntax.
$_GETto access query string and in htaccess you can write rewrite-condition. Come back with your initial effort.[R=307,L]to cause the browser to re-submit the same POST data to the new URL.