How do i make my website only accept connections from Firefox?

5 replies
Hello,
My website loads all falty when in ie, but works fine in firefox.
I havent tested in any other browser and i need to know how to block all browsers exsept FireFox and it shows a message.

Thanks.
#accept #connections #firefox #make #website
  • Profile picture of the author mywebwork
    You seriously want to block IE, Safari, Chrome and Opera users from your site?

    Why not fix your site so it displays properly in ALL browsers, if it doesn't then you obviously have something wrong with the HTML coding - it's not the web browsers fault. Run your site through the W3C Validator and look at the error messages, they will explain how to fix it:

    The W3C Markup Validation Service

    If you really insist on blocking all non-Firefox users you can probably write code to do browser detection, JavaScript make this pretty easy.

    JavaScript Browser Detection
    https://developer.mozilla.org/en/Bro...rowser_Support

    But honestly you REALLY should fix your bad code instead, and make your site available to everyone. Unless you are on an Intranet you don't have control over what browser your user is viewing your site on.

    Bill
    {{ DiscussionBoard.errors[4398020].message }}
  • Profile picture of the author mjbaker
    Originally Posted by luxifia View Post

    Hello,
    My website loads all falty when in ie, but works fine in firefox.
    I havent tested in any other browser and i need to know how to block all browsers exsept FireFox and it shows a message.

    Thanks.
    I know you've been told to fix your site, but it could be that you are running on an Intranet or someplace where you only want to use Firefox as the browser. If it's not just coding problems, and you want a sure fire way to determine which browser and ever which version of a browser is accessing your site, you can use jQuery. It's free and can do what you need in a few lines of code. It's open source. jQuery: The Write Less, Do More, JavaScript Library

    Mike
    {{ DiscussionBoard.errors[4410124].message }}
  • Profile picture of the author haha0212
    to limit the user agent through Server Side Includes
    {{ DiscussionBoard.errors[4499035].message }}
  • Profile picture of the author SebastianJ
    As mywebwork said - you shouldn't limit your site to firefox only - make it cross-browser instead.

    If you really want to block it though - use php etc. and check the user agent string of the visitor with a regex, if it doesn't match a firefox user agent, show them a blank page or redirect them somewhere. This is the same method you use if you want to show different content for Google's crawl bot and for your visitors (if you ever have a need for that).
    {{ DiscussionBoard.errors[4505216].message }}

Trending Topics