views:

2969

answers:

6

I have a page using something along the lines of

<meta http-equiv="refresh" content="0;url=http://example.com/" />

but for certain users on a certain workstation this doesn't work. The is in IE. Is there something wrong with cookies or a setting somewhere which would cause this to fail? I never heard of such a thing.

A: 

Just a wild guess: maybe there are some adblockers installed on those machines where the redirect does not work. Can't think of any other reason why this common technique works on some machines while it fails on others for you.

Kosi2801
A: 

is it a really old version of IE? if so, try:

<meta http-equiv="refresh" content="0;url=http://example.com/"&gt;&lt;/meta&gt;
Cal
+2  A: 

The META tag is not an empty tag and does not have a closing tag in HTML, only in XHTML. (If you are really are sending XHTML, it may not work right on older versions of IE anyway, there are only workarounds to send XHTML to older IE versions.)

Try:

<meta http-equiv="refresh" content="0;url=http://example.com/"&gt;

W3C META Tag Description

You might also try:

  1. Checking the major and minor versions of IE. You can do this on the help->about menu option.
  2. IE has historically gotten all confused by filenames and MIMEtypes. Make sure that you are sending your HTML as an htm or html extension file, and that those filetypes are set up on your server to send text/html mimetype.
  3. Make sure your server isn't sending a conflicting meta refresh http header.
DevelopersDevelopersDevelopers
+3  A: 

There is a security setting in internet explorer that does not allow meta tag refresh. It is under the Security tab, then choose Custom Level and the Meta Tag Refresh under Miscellaneous. If that is disabled, it would stop the meta refresh from working.

Austin
+1  A: 

Maybe you should just write a new script that tells all IE users to F*CK OFF and get a better browser, any browser, just not IE! It causes way too many problems!

Ah, I almost got too carried away with my rant to answer you. The actual problem is that when IE sees this:

<meta http-equiv="refresh" content="0;http://www.example.com" />

it expects the contents attribute to contain a number. The only time IE will check for a URL is if the content attribute contains "URL=" so the redirect that is most usable in all browsers is this:

<meta http-equiv="refresh" content="0;URL=http://www.example.com" />

The above example would redirect immdetiately but if you changed the 0 for another number it would wait that many seconds. Hope this all makes sense, it should work just fine but I still think my first idea was the better one.

A: 

Check out this solution. It handles both javascript and meta-refresh at the same time: Meta-refresh and javascript

Haluk