Page 1 of 2 12 LastLast
Results 1 to 25 of 29
  1. #1
    Join Date
    Nov 2006
    Location
    Sunderland, UK
    Posts
    21

    Blocking Firefox.

    Hi,

    I was wondering if there anyway to block firefox from accessing my site? And if there is, could you please post the code to do so.

    Danny.

  2. #2
    Join Date
    Jan 2006
    Location
    Athens, Greece
    Posts
    1,481
    Either from Apache conf by checking the Browser string or with javascript. I think with PHP too, but can't recall.
    I will return with examples.

  3. #3
    I would rather plan to Dump IE, FF Rocks
    << Please see rules regarding signature setup >>

  4. #4
    Join Date
    Jan 2006
    Location
    Athens, Greece
    Posts
    1,481
    hostcurry you are right, anyway here is some examples:

    PHP
    $browser = $_SERVER['HTTP_USER_AGENT'];
    if (($pos = strpos($browser, "Mozilla")) !== false)
    {
    echo 'Mozilla blocked';
    }
    Javascript, refer here:
    http://www.netmechanic.com/news/vol3...cript_no15.htm


    EDIT: tested and fixed PHP code
    Last edited by Steve_Arm; 08-21-2007 at 03:41 PM.

  5. #5
    Join Date
    Nov 2006
    Location
    Sunderland, UK
    Posts
    21
    Thanks alot.

  6. #6
    Join Date
    Dec 2002
    Location
    Ferenginar
    Posts
    4,157
    Just curious, why would you want to block FireFox?

  7. #7
    Join Date
    Jan 2003
    Location
    U.S.A.
    Posts
    3,928
    Maybe his website isn't compatible with firefox...

  8. #8
    Join Date
    Aug 2002
    Location
    Superior, CO, USA
    Posts
    635
    And remember to tell your users about tools to get around this.

  9. #9
    That would be really bad to block firefox from a website. Users are not going to go through the trouble to open a separate browser to view a website. Make the site compatible to firefox and IE or sales will suffer.
    extenddigital
    www.extenddigital.com
    affordable : reliable : manageable

  10. #10
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Quote Originally Posted by stdunbar View Post
    And remember to tell your users about tools to get around this.
    Exactly. There's no way to reliably block Firefox or any other browser from accessing your site. Why do you want to?
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  11. #11
    Join Date
    Mar 2007
    Location
    Phoenix, AZ, United State
    Posts
    1,525
    You can change your user-agent passed with firefox in it's config. There is nothing you can do here that will work 100%.
    drew@slicie.com - Vertical Scaling Servers
    30 Minute Backups - Pay for what you use

  12. #12
    Well, while I won't tell you what to do, I will give you my two cents.

    If you decide to do that, you are going against everything that every web designer strives for, from a business aspect anyway, and that is 100% compatibility. When you block firefox, you are are cutting out 25-40% of your potential market. Not so much of a good idea if you like making money. You will steer plenty of potential customers away. Now again this is all assuming this is for a business, but even if it is not, you will still push away plenty of visitors.

    Just curious why you would be against Firefox. Speed, reliability, security, usability. It has all those things, and last time I checked Internet Explorer had none of those. Although IE7 has tabs, but I heard someone found a security hole through the tabbing system that could allow them to format your harddrive and steal your credit card numbers. (I Kid, just my opinion about IE).

    Cody

  13. #13
    Join Date
    May 2007
    Location
    Orange Country, CA
    Posts
    138
    Bizarre requests like these stem only from a lack of understanding of computer systems. Attempting something like this is a practice in futility. You can not successfully block any computer system from making HTTP requests to your website without blacklisting IPs.

    The only explanation, I can think of, for attempting something so ridiculous as this is as a prank. "Ha ha, I made it so you can't view my site with Firefox. You have to use some other browser! Ha."

    Lame.
    Blesta - Professional Billing Software
    We are about creating good experiences
    Trial - Demo | 866.478.7567 | Twitter @blesta

  14. #14
    Join Date
    Apr 2003
    Location
    Los Angeles, CA
    Posts
    820
    Quote Originally Posted by Steve_Arm View Post
    $browser = $_SERVER['HTTP_USER_AGENT'];
    if (($pos = strpos($browser, "Mozilla")) !== false)
    {
    echo 'Mozilla blocked';
    }
    Excellent! You have now blocked half of the world. Last time I checked Internet explorer identified itself as "Mozilla":

    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322)

    And as a personal opinion, if you're blocking Firefox, you lost a potential customer: me. Sorry, but I'm NOT going to switch browsers just to see your site. I just don't care that much. That's my attitude, and I wonder how many other surfers share it.
    Pings <1 ms, Unlimited Transfer, Lowest Price: http://localhost/

  15. #15
    Join Date
    Dec 2002
    Location
    Jackson, MI
    Posts
    1,525
    I share you view, except in the case of my bank, which I would switch, but cant atm. There website will not allow me to do a few things in firefox, but its not stuff I have to do most of the time anyways.

    Any business that cannot make there site work in firefox, is a business I do not ever want to do business with!

  16. #16
    Join Date
    Jan 2006
    Location
    Athens, Greece
    Posts
    1,481
    Luki,
    clever signature, very funny.
    Yes you are right, now I'm blocking the world. Only Opera users will see the site. More than expected.
    It isn't "Mozilla" then it's "Firefox".
    A minor error to quickly help the fellow here. Of course I wouldn't block FF either, but let the guy do what he wants, it's his site.


    Quote Originally Posted by luki View Post
    Excellent! You have now blocked half of the world. Last time I checked Internet explorer identified itself as "Mozilla":

    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322)

    And as a personal opinion, if you're blocking Firefox, you lost a potential customer: me. Sorry, but I'm NOT going to switch browsers just to see your site. I just don't care that much. That's my attitude, and I wonder how many other surfers share it.

  17. #17
    Join Date
    Nov 2005
    Location
    Palma de Mallorca, Spain
    Posts
    263
    The only explanation, I can think of, for attempting something so ridiculous as this is as a prank.... Ha ha, I made it so you can't view my site with Firefox. You have to use some other browser! Ha.
    What a surprise, that "ridiculous thing" is what not-always-teens have been doing for years when it comes to filter Internet Explorer in their websites since "Netscape" times Ridiculous things come from both sides...

    I have another nice theory about the thread starter reasons to filter firefox... perhaps he wants to avoid the use of firefox *addons* that allow to "play" with his site like "tamper data" addon

    Yeah it seems that someone read this about "Turning Firefox to an [Ethical] Hacking Platform"
    http://www.security-database.com/too...n-Ethical.html

    I'm being ironic of course.

    Plain and simple as other people stated: allow your web users come from IE, Firefox, Opera and Safari... try to be compatible. If you're not full compatible, see your stats. If you're firefox/opera/safari traffic is 2% at your homepage... well... don't waste your time.

    My two cents!

  18. #18
    Join Date
    May 2007
    Location
    Orange Country, CA
    Posts
    138
    Quote Originally Posted by juangake View Post
    What a surprise, that "ridiculous thing" is what not-always-teens have been doing for years when it comes to filter Internet Explorer in their websites since "Netscape" times Ridiculous things come from both sides...
    I'm not taking sides here. IE, Opera, Firefox, Safari... doesn't matter. Trying something like this is a waste of time and effort.

    Quote Originally Posted by juangake View Post

    I have another nice theory about the thread starter reasons to filter firefox... perhaps he wants to avoid the use of firefox *addons* that allow to "play" with his site like "tamper data" addon
    Hahaha! If this is true, and I sorely hope that it is not, this is again, another misconception of computer systems.
    Blesta - Professional Billing Software
    We are about creating good experiences
    Trial - Demo | 866.478.7567 | Twitter @blesta

  19. #19
    Join Date
    Nov 2005
    Location
    Palma de Mallorca, Spain
    Posts
    263
    Okay, I've been told by a friend that lately some webmasters are willing to block firefox due some addons designed to block advertisement banners. Well, it's a reason... That could explain it all, since the thread starter didn't say anything about it... *grin*

  20. #20
    While this is true, if webmasters decide not to do business with anybody who has a browser for which there exists an addon that can block advertising, they won't have a lot of visitors left

  21. #21
    Probably they would like to block firefox, because they show big amount of banners... AdBlock is very cool

  22. #22
    Use a JS Method to check the useragent and redirect the user to a fail page.. If they want to get in while it looks bad to firefox, it's really their choice, so put a link on that page so they can decide to view it or not

  23. #23
    Join Date
    Aug 2005
    Posts
    3,587
    A desperate attempt to stop Firefox and his uber-feature AdBlockPlus.

    Let me remind you that another extension allowes changing of user agent I can make Firefox appear as IE7.

  24. #24
    Join Date
    Aug 2005
    Location
    UK
    Posts
    654
    You could use "detect by functionality" and not "detect by user agent" like every one else here is suggesting, and like most people, I think it's a bad idea to go down this road as I could even fake this.. but I'll explain..

    In IE vs FX, there are particular objects and functions that do and do not work, or work but with different results.

    A simple example is that the paramitar passed the the onclick="()" function in IE is called e where as in other (decent, read Firefox, KHTML, WebKit, Opera) browsers it would be Event..

  25. #25
    Join Date
    Aug 2006
    Location
    India
    Posts
    32
    Firefox has close to 15&#37; market share at the moment and it is growing. By blocking Firefox, you will be losing out on this large chunk, besides earning their ill-will.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •