Forum Moderators: open

Message Too Old, No Replies

Server Side Denial to IE UA on *SOME* files

Reserving special features for competent browsers

         

JAB Creations

10:12 pm on Nov 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Until MS breaks out with a competent browser I want to restrict IE users from accessing certain parts of my site.

I'd like to do this serverside of course and the first thing I can think of is apache...

... any suggestions?

RonPK

11:02 am on Nov 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



... the Apache forum [webmasterworld.com]?

If you have mod_rewrite enabled on your server, you could try something like this in your .htaccess file:

RewriteEngine On 
RewriteCond %{HTTP_USER_AGENT} MSIE
RewriteCond %{REQUEST_URI} IEgoAway.html$
RewriteRule .* - [F]

Do some reading on mod_rewrite before you start using it.

It sounds a bit silly though to me to block the majority of the web's users just because they're using a browser that you don't like.

Robin_reala

12:43 pm on Nov 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe you code code the special features as external linked files, and just block those? That way IE users get the content but not the whizzbang features.

JAB Creations

7:16 pm on Nov 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The point is to dangle the doggie bone in front of their face and then say, look your browser isn't going to be able handle this (official sounding stuff thats true anyway here); use Firefox (or Opera).

The intent is to not only get people migrated away from IE (and using competent browsers) but also limit bandwidth and associate higher quality with something other then IE. Most people need a good browser anyway, I'm baffled why my roomate doesn't even use Advant though... IE? *shivers*

encyclo

8:22 pm on Nov 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't agree with your idea on this at all: I would wonder if any site is worth downloading a whole new browser for, especially as most users don't have a clue what a browser even is. It's the web developer's job to adapt to users, not the other way round.

Having said that, it's your site, so you can do what you want. Rather than messing with rewrite rules and server-side stuff which may unintentionally shut out users, I would recommend using an IE conditional comment in the page head, as conditional comments are certain to target only IE. The idea would be to block access to IE less than or equal to version 6 (because a future version 7 might be better). The easiest way is to do a simple meta refresh to an explanatory page, thus:

<!--[if lte IE6]><meta http-equiv="refresh" content="0;url=http://www.example.com/i-hate-ie.htm"><![endif]-->

Browsers other than IE just see a comment, so ignore the refresh.

The other way, seeing as you're obviously a standards fan, is to simply use XHTML and serve it with the mime type

application/xhtml+xml
. IE does not recognize this so is unable to render the page. Mozilla and Opera deal with it just fine. The disadvantage with this method is that I know of no search bots which can read
application/xhtml+xml
either.