I
I
Ivan2015-08-19 19:06:28
Apache HTTP Server
Ivan, 2015-08-19 19:06:28

How to pass labels via mobile redirect in htaccess?

There is site1.ru/?idsite={sid}&company={cid} with macros in the link from the ad network.
You need to redirect to site2.ru with site1.ru tags like site2.ru/abc/{sid}/{cid}/ via htaccess.
So far there is:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} (?i:iphone|ipad)
RewriteRule ^(/)?$ site2.ru [R=301]

I think that the transmission should be through the QSA flag.
Something like this:
RewriteCond %{QUERY_STRING} ^idsite=([0-9]+)&company=([0-9]+)$
RewriteRule ^(/)?$ site2.ru/abc/$1/$2 [QSA ,L,R=301]

Please help me understand how this can be done? And is it even possible

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question