Home ERR_TOO_MANY_REDIRECTS htaccess HTTP_REFERER redirect rule
Reply: 1

ERR_TOO_MANY_REDIRECTS htaccess HTTP_REFERER redirect rule

rajmohan
1#
rajmohan Published in 2018-01-11 12:33:37Z

I have many redirect rules in my .htaccess file. All are working fine but when I tried to implement htaccess rule using http_referer browser is showing ERR_TOO_MANY_REDIRECTS message during the redirect. Redirect is working fine.

Here is what I am trying. We have an external site
https://www.abcd.com in which there is a link https://www.xyz1.com/de/TestPass. But it should redirect to
https://www.xyz1.com/de/TestPass?agency=abcd not to
https://www.xyz1.com/de/TestPass

I have tried as shown below:

RewriteCond %{HTTP_REFERER} ^https://www.abcd.com [NC]
RewriteRule ^(.*)$ https://www.xyz1.com/de/TestPass?agency=abcd[L,R=301]

Please help.

Thanks, Raj

Rich Bowen
2#
Rich Bowen Reply to 2018-01-11 15:20:17Z

Before the RewriteRule add

RewriteCond %{QUERY_STRING} !agency

That will avoid the looping.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.302583 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO