How to show challenge to visitors who access specific pages of my website without any referrer?

I want to show challenge to visitors who access specific pages of my website (homepage) without any referrer (Direct visitor). I tried to configure firewall rules but it’s not working properly, maybe there is any sort of error in my configuration.
Kindly suggest me how to configure firewall rules?

I solved this with PageRules.

For example:


Hope this helps you.
This would force all visitors of:

  1. http://sub.domain.tld/login/
  2. https://sub.domain.tld/login/

to challenge a JS Challenge

Pls read this article to understand how PageRules are working:

But as far as I know you cant filter them by if they are referrer or not, but you can vote for this feature:
https://community.cloudflare.com/t/61

1 Like

Hi @user1124,

This should be possible with a firewall rule:

(http.referer eq "")
Then…
JS Challenge

1 Like

(http.referer eq " ")
this means no need to write anything in “value”. right?

Correct, you can also click ‘Edit expression’ and paste in (http.referer eq "")

1 Like

Perfect!!
What about specific page or URL challenge?
(http.request.full_uri eq “https://example.com/” and http.request.full_uri eq “http://example.com/”)

Its also doesn’t worked for me.

Specific page of my website.

You could combine the two with something like

(http.request.uri eq "/page") or (http.referer eq "")
Then…
JS Challenge

1 Like