User agent stylesheet overrides my css


My website get traffic from Facebook. Since last week, I did notice a lot of “Direct” traffic on my Google Analytics board, up to 200 users at the same time.

I did setup a Firewall Rules to allow only traffic from Facebook, and block all others sources.

So the rule is : (not http.referer contains “facebook”) then Block

It’s working, but all users get a page without any css organisation, because user agent stylesheet overrides my css.

The question here is how to fixe this?

Is there any better way to block this Direct traffic ??

Thank you!

So, you have the “Not” facebook referer blocked. You may have to add a first rule that will “allow” all necessary file extensions, like css, js, jpg, png, etc.

The problem is not that anything is overridden, but rather that you block all requests which are not originating from Facebook, which includes requests with a referrer from your very own site. You should add an and’ed second not contains with your own domain name. Still, this will block legitimate requests with empty referrers as well.

Generally, referrer blocks are never a good idea unless one knows exactly what they are doing.

1 Like

Did this, new rule with css & js files, but still the same issue.

I did add my own domain to referer rule : (not http.referer contains “facebook” and http.referer ne “mydomain”) but still the same problem.

is there another way to achieve this? blocking all traffic that’s not coming from Facebook??

I wrote a second not contains, not ne.

My bad !! all good, thank you so much.

1 Like