Is it possible to code so your website only allow Firefox browser to connect?

2

As the title says, was curious if it's possible and how? Thanks! :)

Exid

Posted 2015-10-13T08:27:27.520

Reputation: 43

Short answer: Maybe. There would be ways around any such block (spoofing the user agent for example). How is too broad a question. – DavidPostill – 2015-10-13T08:31:17.347

Only allow Firefox to connect? No. Firefox is an HTTP client; any HTTP client can connect to your server (or, indeed, any TCP client that can send and receive plain text; I regularly connect to web servers with tools like netcat that are just TCP clients and I do the HTTP myself). You can add user-agent header filtering, but anybody who wants to can spoof Firefox in the UA header and bypass that. You might be able to make it so any browser except Firefox will fail to render the page correctly, but it would still be possible to read the content in the page source. – CBHacking – 2015-10-13T08:32:26.180

@CBHacking Ohh, can you give an example of user-agent filtering? Curious to see how it would look like! :) – Exid – 2015-10-13T08:38:31.763

http://askubuntu.com/questions/45753/accessing-ie-only-sites – h0ch5tr4355 – 2015-10-13T08:39:47.543

1

This should be on http://webmasters.stackexchange.com/

– Chenmunka – 2015-10-13T10:10:38.083

Answers

1

I search a bit and wrote this in .htaccess (not sure if it's 100% right but seems to work)

RewriteEngine On RewriteCond %{HTTP_USER_AGENT} !Firefox* [NC] RewriteRule ^ - [F,L]

Exid

Posted 2015-10-13T08:27:27.520

Reputation: 43

There are various browser detection techniques based on the specified user-agent, but note that the user agent can be arbitrary modified by the user/app, is not a secure detection. – ElektroStudios – 2015-10-13T09:00:00.210

It is a trivial task to indicate the user agent is Firefox using pretty much any major browser . – Ramhound – 2015-10-13T10:15:28.230