0

I searched a lot on different topics but this problem has not asked yet.

I want to redirect http://examplesite.com/page1 to http://examplesite.com/page2 using .htacess file, if and only if the user is coming to this page from google search engine.

in other words, the user should not be redirected in the below conditions:

  1. if the user is not visiting the page1

  2. if the user is visiting the page1 but http_refere is not equal to google

Asghar M
  • 33
  • 1
  • 4
  • This might be helpful for you: https://stackoverflow.com/questions/34200125/how-does-google-sets-http-referrer-after-a-search-result-click – arkascha Jun 23 '19 at 09:50
  • Possible duplicate of [Redirect using htaccess based on referrer](https://stackoverflow.com/questions/13106299/redirect-using-htaccess-based-on-referrer) – Capsule Jun 23 '19 at 23:53
  • Also, regarding your first point, how on earth would someone NOT visiting page1 be redirected from page1 to page2? Mystical forces? – Capsule Jun 23 '19 at 23:54
  • Google’s response headers include `Referrer-Policy: no-referrer-when-downgrade`, so unless your page is using HTTPS, you should not be getting any referrer to begin with. – 04FS Jun 25 '19 at 09:03

0 Answers0