S
S
Serafim Ivanov2019-02-24 01:12:03
htaccess
Serafim Ivanov, 2019-02-24 01:12:03

Redirect based on content Cookies?

You need to set up redirects to different pages depending on the content of a particular cookie.
That is, if the content of Moscow - redirect to one page
If the content of St. Petersburg - to another, and so on
And if the cookie does not exist yet to another.
Tell me how this can be implemented? Preferably with .htaccess file

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-02-24
@serafimraw

RewriteCond %{HTTP_COOKIE} (?:^|;\s*)city=([^;]+)
RewriteCond "%1  moskva=url1  omsk=url2  orsk=url3" "^(\S+) .*?\1=(\S+)"
RewriteRule ^  /%2 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question