Forum Discussion
Arie
Altostratus
May 06, 2008IE obeying - sometimes?
I've got an iRule that is supposed to redirect the browser to a new URL to ensure that the user is using "www" as a subdomain. Quite basic stuff. Works great in Firefox, but it's hit and miss in IE (esp. IE 6). Sometimes the browser follows the redirect and reposts the request with the www, sometimes the server comes back with "domain not found". The most bizarre event is when the redirect is to another domain and the browser (IE) manages to display the proper page while showing a domain in the address bar where the page certainly does not exist!
------------------------------------
when HTTP_REQUEST {
set enabled true
if { $enabled } {
if { not ([matchclass [string tolower [HTTP::host]] equals $::ExcludeFromWWWRedirect]) and not ([string tolower [HTTP::host]] starts_with "www") } {
HTTP::respond 301 Location http://www.[HTTP::host][HTTP::uri]
}
}
}
------------------------------------
HTTP Headers look fine (taken from Firefox):
http://domain.org/robots.txt
GET /robots.txt HTTP/1.1
Host: domain.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
HTTP/1.x 301 Moved Permanently
Location: http://www.domain.org/robots.txt
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
----------------------------------------------------------
http://www.domain.org/robots.txt
GET /robots.txt HTTP/1.1
Host: www.domain.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
HTTP/1.x 200 OK
Content-Length: 1068
Content-Type: text/plain
Content-Location: http://www.domain.org/robots.txt
Last-Modified: Thu, 23 Aug 2007 22:45:21 GMT
Accept-Ranges: bytes
Etag: "7bea2649d7e5c71:bd4c"
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Tue, 06 May 2008 00:03:49 GMT
Connection: close
Vary: Accept-Encoding, User-Agent
Content-Encoding: gzip
- Colin_Walker_12Historic F5 AccountThat definitely sounds strange! The fact that it's working in FireFox leads me to believe that your iRule is set up properly, as far as the standards are concerned. I would probably take a look on Microsoft's site to see if there are any similar known issues with IE, as it sounds like they've got some different requirement or setting somewhere that's causing you this grief.
- Arie
Altostratus
1) - Yes, if you have multiple iRules assigned to your virtual, a HTTP::respond/redirect will not terminate processing of the rest of the iRules. An event disable should work but keep in mind that that will disable all event processing for that entire connection. Also, you may want to not do a "event disable all" as that will disable all events that you may or may not have iRules associated with. If you are using keep-alive connections then subsequent requests going over that same connection will not be processed. You can just disable the HTTP_REQUEST events by using "event disable" without the "all".
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects