Log in

View Full Version : FireFox Redirect



MurderSkillz
10-21-2005, 02:55 PM
I was wondering if anyone had the code to redirect a firefox user to a specific place without it displaying a warning they will be redirected..so i pretty much want them to go to my page and then get redirected to my other page automatically without them getting a warning. Does anyone have this code if its possible? plz help!! :(

Twey
10-21-2005, 06:08 PM
Just Firefox, or any browser other than IE?
For just any other browser, you can do:

<!-- [if !IE]--><meta http-equiv="refresh" content="0;other-page.htm"/><!--[endif]-->
By the way, I advise making your Firefox page the default, not the IE page. This is because Firefox is a more standards-compliant browser than IE, so if something goes wrong and a user of another browser gets stuck on the default page, it'll look better. You would do this like so:

<!-- [if IE]><meta http-equiv="refresh" content="0;ie-page.htm"/><![endif]-->

MurderSkillz
10-27-2005, 04:46 PM
yea see what i have i have it to redirect with IE so i can just insert that code the very first one u posted plus my IE redirect? and then it will redirect IE and all others like firefox and opera and stuff like that? correct me if im wrong

Twey
10-27-2005, 05:06 PM
You:re right, except where you say " it will redirect IE and all others". It won:t redirect IE. That:s the point.

P.S. sorry for the funky punctuation, I:m using a LiveCD that:s decided I have a Japanese keyboard layout.

jscheuer1
10-27-2005, 05:52 PM
Just Firefox, or any browser other than IE?
For just any other browser, you can do:

<!-- [if !IE]--><meta http-equiv="refresh" content="0;other-page.htm"/><!--[endif]-->

The if/endif statement above isn't working here. This conditional comment can be used to screen in IE:

<!--[if IE]>
whatever
<![endif]-->

But, because it is IE proprietary, the reverse is not true, ex:

<!--[if !IE]>
whatever
<![endif]-->

because other browsers have no idea what you are talking about. See:

http://www.quirksmode.org/css/condcom.html

for proper usage and syntax of this 'feature'. I've found that exact syntax including spaces used/omitted is important.

Twey
10-27-2005, 07:02 PM
I'm sorry, take the double-dashes out of those tags. It should work then. It won't, however, be valid HTML, if you are worried about this.

What I was attempting to use here, John, was the "downlevel-revealed conditional comment" (all browsers but IE being arrogantly classed as "downlevel browsers"). See http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp for further info.

ekko
05-26-2008, 03:43 AM
i was trying to figure out after reading this how i would do the same thing for opera and safari?
myself im trying to create a meta refresh for everything except firefox..
this topic was verry helpful so far..

jscheuer1
05-27-2008, 11:51 AM
There is no way to single out/exclude FF on the basis of HTML alone and the browser sniffing involved could be tricky - for example, what about Netscape 6+ which often acts just like FF? In any case, you couldn't do it with just a meta refresh tag and some comment tags. You could use javascript, but users with javascript disabled wouldn't necessarily get what you are intending unless you also had a separate 'path' for them to follow.

I suspect that the reason you want to 'avoid' FF has to do with issues that might be better solved in a different way. What exactly is the trouble with FF?

molendijk
05-27-2008, 02:20 PM
It won't, however, be valid HTML, if you are worried about this.
Twey, what do you mean? The following is valid HTML 4.01 Strict

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!--[if IE]>
<meta http-equiv="refresh" content="0;other-page.htm"/>
<![endif]-->

<!--[if !IE]>
<meta http-equiv="refresh" content="0;other-page.htm"/>
<![endif]-->

</head>

<body>
<p>Content</p>
</body>

</html>
---
Arie.

Medyman
05-27-2008, 02:33 PM
Twey, what do you mean? The following is valid HTML 4.01 Strict


I'm sorry, take the double-dashes out of those tags. It should work then. It won't, however, be valid HTML, if you are worried about this.

I think that's what he meant, anyway.

jscheuer1
05-27-2008, 02:46 PM
I think you could solve the validity and utility issues if you have a refresh on 0 in the IE comment block, and then a refresh on 1 below it, completely uncommented. IE should never get to the uncommented one, all others will.

What Twey meant though is that if you do it like Arie has it, the other browsers won't see the second refresh, and if you do it so they will, while excluding IE using the 'downlevel' comments without dashes, it will then be invalid code.

You can also exclude IE with valid code like so:


<!--[if !IE]> <-->
all but IE see this
<!--> <![endif]-->

ekko
05-27-2008, 03:10 PM
i have the ie redirection working perfectly on this page..
http://ekko.x10hosting.com/
and my purpose for redirection for all the brousers really dosent matter..i mean really who wants to code for every singe brouser out of there...but i think by removeing ie as i have done i saved my self a lot of time anyway...
thanks for the help, ive decided to leave it as is and just put up a block that says the sites best view is with firefox and 1280 x 1024

jscheuer1
05-27-2008, 04:24 PM
i have the ie redirection working perfectly on this page..
http://ekko.x10hosting.com/
and my purpose for redirection for all the brousers really dosent matter..i mean really who wants to code for every singe brouser out of there...but i think by removeing ie as i have done i saved my self a lot of time anyway...
thanks for the help, ive decided to leave it as is and just put up a block that says the sites best view is with firefox and 1280 x 1024

That's a great way to limit traffic, and from the looks of it, business. If you are going to do this though, why not make the IE redirect one of the first things on the page, so that the user doesn't have to wait for the page to load before getting kicked out. If you don't know what I mean, clear your IE browser's cache and then navigate to the live page.

However, and by your own admission it seems, this is the lazy way out.

ekko
05-27-2008, 06:34 PM
if you have a better way to do the redirection..im open to suggustion of corse..and yes i belive theres gota be a better way..but i dont know how ...its not that im being lazy its that i dont see the big deal anymore...as for traffic it really dosent matter to me how many ie users get redirected to download firefox. the have the option to visit if they want..this site is for me and my friends who use firefox or safari...thats the best view for it anyway..