WordPress.org

Ready to get started?Download WordPress

Forums

Redirect IE8 users to another site (6 posts)

  1. Mickey44
    Member
    Posted 3 years ago #

    I'm looking for a way of redirecting Internet Explorer 8 browser users to another site (IE8 is having problems displaying my new site so I want to send all IE8 users to another domain with my old site which displays fine). I've got the 'php-browser-detection' plugin installed but not sure how to set up a redirect. I know the code for a redirect is something like this:

    <meta http-equiv="Refresh" content="0; url=http://domaingoeshere/">

    And I think the code needs to go in here where 'do stuff' is.

    <?php if ( is_lt_IE8() ) { do stuff }; ?>

    I'm not a coder so I may have this totally wrong but if anyone can help that would be great. Thanks.

  2. brough
    Member
    Posted 2 years ago #

    I too would like the answer to this question.

  3. Mickey44
    Member
    Posted 2 years ago #

    This was already resolved about 5 months ago. Here's the link:

    http://wordpress.org/support/topic/redirect-ie8-users-to-another-site-1?replies=13#post-2298113

    The solution suggested by Big Bagel worked.

  4. MartyThornley
    Member
    Posted 2 years ago #

    This topic has come up a few times with questions about the PHP browser detection plugin, but this is not what it is built for...

    As mentioned in the post linked to above, redirecting based on browser is a bad idea because it is considered black hat SEO technique.

    It would be much better to hook into the template_redirect action and serve a different page template.

    But there is usually a simpler way to solve cross-browser issues within the page, which is the real intent and best way to use this plugin. But if you really want to send to a new "page", I would recommend using the template_redirect hook.

  5. brough
    Member
    Posted 2 years ago #

    Thanks, I tried the suggestion at http://wordpress.org/support/topic/redirect-ie8-users-to-another-site-1?replies=13#post-2298113 to no avail. It ignored the redirect and served the original page to IE8 - a blank page, in fact, as IE8 has problems. Tried it several times, checked that code was actually being served, but nada. Went back to the plugin and modified that to give IE8 users a chance to go to a static page.

  6. Mickey44
    Member
    Posted 2 years ago #

    Here's the code, which I pasted at the start of the header.php. I tested it on a PC running Windows XP on IE8 and it redirects no problem. Might be worth trying Marty's suggestion if that doesn't work.

    <?php if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 8' ) ) {
    header( 'Location: http://domaingoeshere' );
    } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic