Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / November 2004



Tip: Looking for answers? Try searching our database.

Only Allow Microsoft IE Browser To View Site - All  Other Browsers Are Redirected

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Information - 29 Nov 2004 17:09 GMT
I'm looking for a script that will check a visitors browser.

Now, I only want visitors using Microsoft InterNet Explorer to visit
existing URL and all other browsers will be redirected to another part
of my site.

I've checked a bunch of scripts but you have to identify every darn
browser available.  All I want to do is check for any version of
Microsoft InterNet Explorer and redirect all other browsers to another
URL.

Any help would be greatly appreciated.

Thanks!
Ivo - 29 Nov 2004 17:51 GMT
> I'm looking for a script that will check a visitors browser.
>
[quoted text clipped - 6 lines]
> Microsoft InterNet Explorer and redirect all other browsers to another
> URL.

Not true. Think the other way around, and redirect all IE browsers to a
dedicated page with a conditional comment, which is something that only IE
understands and is incidentally more politically correct:

<!--[if IE]>
<meta http-equiv="refresh"content="0;url=http://www.mysite.com/ieonly.htm">
<![endif]-->

All other browsers will treat this whole block as a HTML comment and ignore
it.
It goes without saying that it is always best to stay away from browser
sniffing scripts in general and those that read the user agent string in
particular as they are not reliable enough, and on the www one should really
not design for a specific browser to begin with.

HTH
--
Ivo
http://www.vansandick.com/
Mick White - 29 Nov 2004 18:00 GMT
[snip]

> <!--[if IE]>
> <meta http-equiv="refresh"content="0;url=http://www.mysite.com/ieonly.htm">
> <![endif]-->
>
> All other browsers will treat this whole block as a HTML comment and ignore
> it.

Not applicable to IE Mac....
Mick
Information - 30 Nov 2004 01:56 GMT
SNIP

> <!--[if IE]>
> <meta http-equiv="refresh"content="0;url=http://www.mysite.com/ieonly.htm">
> <![endif]-->
>
> All other browsers will treat this whole block as a HTML comment and ignore
> it.
SNIP

Works like a champ!  Thanks for your help.
RobG - 30 Nov 2004 02:13 GMT
> SNIP
>
[quoted text clipped - 8 lines]
>
> Works like a champ!  Thanks for your help.

 I presume that if the user has disabled "refresh" then it won't.  And
 given the annoyance caused by pages that refresh themselves, the number
 of users with it disabled will grow.

 You have no way of detecting it unless they take the time to e-mail you
 and complain.

Signature

Rob

Information - 30 Nov 2004 11:24 GMT
> > SNIP
> >
[quoted text clipped - 15 lines]
>   You have no way of detecting it unless they take the time to e-mail you
>   and complain.

Well, we can only do our best to make our visitors comfortable.  It is
very very unfortunate that different browsers handle html and java
differently.

Thanks!
Andrew Thompson - 30 Nov 2004 12:22 GMT
> Well, we can only do our best to make our visitors comfortable.  

Admirable.

>..It is
> very very unfortunate that different browsers handle html and java
> differently.

Yes it is, but that is the way it is.  However, they generally
render valid mark-up in a logical way, certainly not the same
as each other, but well enough for the visitor to access and use
the content.

OTOH, you can use CSS import hacks to ensure that the *formatting*
is the same on a multitude of browsers.  It's advantages are that
it works even if..
1) Client side script is disabled.
2) META-REFRESH redirect is disabled.

Further, it requires no 'second page', and works according to the
browser's parsing engine, rather than the browser type it claims to be.

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Mark Preston - 30 Nov 2004 14:39 GMT
>>Now, I only want visitors using Microsoft InterNet Explorer to visit
>>existing URL and all other browsers will be redirected to another part
>>of my site.

Got to say that I can't think why you would want to do that at all. It
makes things harder to maintain and seems to serve no useful purpose.
I'm sure you must have your reasons and admit that I'm curious - but its
none of my business.

> Not true. Think the other way around, and redirect all IE browsers [snip]
>
> <!--[if IE]>
> <meta http-equiv="refresh"content="0;url=http://www.mysite.com/ieonly.htm">
> <![endif]-->

Splendid tip - for the unimaginable case that you might need it.
Information - 30 Nov 2004 19:52 GMT
> >>Now, I only want visitors using Microsoft InterNet Explorer to visit
> >>existing URL and all other browsers will be redirected to another part
[quoted text clipped - 4 lines]
> I'm sure you must have your reasons and admit that I'm curious - but its
> none of my business.

SNIP

Well, my son's website developer moved away and my son asked me to
pick up his site for now (my son owns a Comic Book store).  The site
is stock full of java with all kind of neat stuff taking place on all
the pages.  I was "fat and happy" with the updates and decided to take
a look at the site using NetScape 7x, Opera, Mozilla FireFox, Mozilla
Navigator, and NetScape 4x.  Geeeez, everything looked perfect with IE
but was a total mess with most of the other browsers.  I started to
play with the files and came close with all my test browsers but not
close enough for me!  I decided that I would rather limit the viewing
for now (with an explanation to visitors using other browsers) while
redesigning the site so it is compatible with all browsers.

Hope I wasn't long winded on my explanation.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.