IE Browser Redirect
Hey everyone, I am looking for some code that would help me redirect all of the IE users to my blog instead of my main page.
Can anyone can help?
Looks like a meta redirect inside a conditional comment might work. Something like this (untested):
Edit: just the basic structure here...I didn't include it but it obviously needs doctype, etc.
<meta http-equiv="refresh" content="2;url=http://www.google.com/">
Why? Sounds like an obtrusive way to treat the users.
Originally Posted by Scuzzelbutt
The code works thanks CFHutton.
@Kor I agree completely but I am just starting to learn to dead with the DIVs instead of tables and in IE it's just a mess while Opera, Firefox, Safari, Crome, Etc etc users view the website fine. This is a temp fix I really don't want to do but it's what it is now.
Yes sir! but I still do hate IE.
You shouldn't. A coder should work with the "client's material". This is the browsers' market, and our sites should be seen by all the people regardless their browsers. We are coding for the people, not for the browsers' vendors, remember!
Originally Posted by Scuzzelbutt
With a certain exception: the only stupid browser we should hate is IE6. Yes Sir! Let's persuade the users to get rid of it, I agree.
Well in that case take a look at the website I am creating. Remember I am learning DIV's, I've been a tables guy for awhile now so making the transition is kind of a pain in the .
Looks beautiful in most browsers... grrr!
First thing I check when analyzing a site is to see how it will validates the W3C rules. Yours has about 30 errors. Maybe you should start from that
Try to validate your site at:
The errors are mainly from the Random Testimonial Generator that I found, I made some changes to it so make it work for me now.
The main problem I am coming across is the CSS DIV tags, they are being sassy and not going to the places I want them to (in IE), lol. Seriously though, it's a learning process and that's why I am starting with my own site that people won't see until it's ready.
You didn't provide a link to your site so I don't really know the nature of your errors, but IE can be very finicky about certain style properties depending upon the !DOCTYPE specified (or the absence on one). You might try experimenting with that.
Well, we would like to test it in IE, but since you have performed that redirection...
rofl, my bad.
I took it off, thanks.
I must tell you that the document looks OK in IE8, so that if you need a temporary redirection, do it for IE7 and below (as in IE6 everything is a mess - no wonder, IE6 is a mess by definition, so don't bother to code for it - just leave the redirect later for IE6 only)
Look here the list of IE conditional comments:
Now, back to your page. IE7 is right, after all . You have used an XHTML Doctype, but you have also used a deprecated attribute for your divs: align="center". In fact, align is an HTML attribute used only for table's elements (tbody, tr, td, etc), but not for DIVs.
To center elements on the document you may use CSS. Either text-align (if the elements to be centered are inline elements - like textnodes, span, links, images...) or left and right margin:auto for block-level elements (divs). Here's an article about centering:
You may google for more ...
Last edited by Kor; 11-25-2010 at 07:55 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)