www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: IE Browser Redirect

  1. #1
    Join Date
    Jun 2010
    Posts
    29

    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?

  2. #2
    Join Date
    Mar 2006
    Posts
    172
    Looks like a meta redirect inside a conditional comment might work. Something like this (untested):
    Code:
    <html>
    <head>
    
    <!--[if IE]>
         <meta http-equiv="refresh" content="2;url=http://www.google.com/">
    <![endif]-->
    
    </head>
    
    <body>
    </body>
    
    </html>
    Edit: just the basic structure here...I didn't include it but it obviously needs doctype, etc.

  3. #3
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by Scuzzelbutt View Post
    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.
    Why? Sounds like an obtrusive way to treat the users.

  4. #4
    Join Date
    Jun 2010
    Posts
    29
    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.

  5. #5
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by Scuzzelbutt View Post
    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.
    OK. Sounds logical As long as you intend to find some time to make a cross browser site

  6. #6
    Join Date
    Jun 2010
    Posts
    29
    Yes sir! but I still do hate IE.

  7. #7
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by Scuzzelbutt View Post
    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!

    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.

  8. #8
    Join Date
    Jun 2010
    Posts
    29
    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 .

    http://www.jeffsmith-freelancer.com/...home/index.php



    Looks beautiful in most browsers... grrr!

  9. #9
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    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:
    http://validator.w3.org/

  10. #10
    Join Date
    Jun 2010
    Posts
    29
    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.

  11. #11
    Join Date
    Mar 2009
    Posts
    507
    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.

  12. #12
    Join Date
    Jun 2010
    Posts
    29

  13. #13
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Well, we would like to test it in IE, but since you have performed that redirection...

  14. #14
    Join Date
    Jun 2010
    Posts
    29
    rofl, my bad.

    I took it off, thanks.

  15. #15
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    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:
    http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

    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:
    http://haslayout.net/css-tuts/Horizontal-Centering
    You may google for more ...
    Last edited by Kor; 11-25-2010 at 08:55 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles