473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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!
Jul 23 '05 #1
8 2580
Ivo
"Information" <vp****@yahoo.com> wrote
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.


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/
Jul 23 '05 #2
Ivo wrote:

[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
Jul 23 '05 #3
"Ivo" <no@thank.you> wrote in message news:<41***********************@news.wanadoo.nl>.. .
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.
Jul 23 '05 #4
Information wrote:
"Ivo" <no@thank.you> wrote in message news:<41***********************@news.wanadoo.nl>.. .
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.


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.

--
Rob
Jul 23 '05 #5
RobG <rg***@iinet.net.auau> wrote in message news:<3H*****************@news.optus.net.au>...
Information wrote:
"Ivo" <no@thank.you> wrote in message news:<41***********************@news.wanadoo.nl>.. .
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.


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.


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!
Jul 23 '05 #6
On 30 Nov 2004 03:24:24 -0800, Information wrote:
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.

--
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
Jul 23 '05 #7
Ivo wrote:
"Information" <vp****@yahoo.com> wrote
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.
Jul 23 '05 #8
Mark Preston <us****@nosource.co.uk> wrote in message news:<co*******************@news.demon.co.uk>...
Ivo wrote:
"Information" <vp****@yahoo.com> wrote
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.

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.
Jul 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

163
by: Shiperton Henethe | last post by:
Hi Know any good utilities to help me strip out the tags that Microsoft Excel 2002 leaved behind when you try and export an HTML format file? This is driving me NUTS. And really makes me...
21
by: fleemo17 | last post by:
I'm diving into the world of CSS and am blown away by the power of it. I'm redesigning a website, trying to eliminate the tables in the layout in favor of CSS. However I've come across a stumbling...
10
by: bbcrock | last post by:
does anyone have sample code to display a pop up when a user leaves the site? I really don't want to use this technique, but the clients demand it. I'm thinking something like un body onunload,...
7
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Kruno | last post by:
Hi ! My problem is : I have a link on my secure part of web site with which user can signout... Along with that below link is users name under which user signs in.. When user presses that link...
7
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the...
0
by: Jeff | last post by:
Hey asp.net 2.0 I want my website to be available only for authenticated users (except the front page (Default.aspx) which all users can view). If an anonymous user tryes to access other...
16
by: Ben Sehara | last post by:
Is there any way I can limit the access to my website? I have a site "A" and I want to allow access to it only from site "B" login user. If someone try to access site "A" directory, I want it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.