F5Hopper_28651
Nov 06, 2013Nimbostratus
Stealth Redirection or URL Hiding
Im not sure you can do this, but I will ask. looking to take www.abc.com/news and have the uri /NEWS actually be news.xxx.com(site is third party)
Thanks
Im not sure you can do this, but I will ask. looking to take www.abc.com/news and have the uri /NEWS actually be news.xxx.com(site is third party)
Thanks
Understand that the [HTTP::uri] is going to produce a new URI that is transparent to the user. So if the user makes a request for "/news/foo/bar", the server will see "/foo/bar", and the client's address bar will not change. There is a minor typo in the above iRule though. It should actually look like this:
funny thing, everytime I add the line it apends a www.www.abc.com to the front of it..but I dont have a rule adding a www to my test virtual server
I tried to change this(HTTP::uri [string map {"/news" "/"} [HTTP::uri]]) where "/" is "/hi" and it doesnt work.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/news*" {
pool news.xxx.com-pool
if { [string tolower [HTTP::uri] equals "/news" } {
HTTP::uri "/"
else {
HTTP::uri [string map {"/news" ""} [HTTP::uri]]
}
}
default {
pool www.abc.com-pool
}
}
}
The previous version would have mapped "/news/foo/bar" to "//foo/bar" (an extra forward slash).
everytime I add the line it apends a www.www.abc.com to the front of it
I'm not sure what this means.
Minor typo:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/news*" {
pool news.xxx.com-pool
if { [string tolower [HTTP::uri]] equals "/news" } {
HTTP::uri "/"
else {
HTTP::uri [string map {"/news" ""} [HTTP::uri]]
}
}
default {
pool www.abc.com-pool
}
}
}
there where some missing braces. not sure if I got them in the right space... but if I now go to www.abc.com/news the url changes to www.www.abc.com its crazy...
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/news*" {
pool news.xxx.com-pool
if { [string tolower [HTTP::uri]] equals "/news" } {
HTTP::uri "/"}
else {
HTTP::uri [string map {"/news" ""} [HTTP::uri]]
}
}
default {
pool www.abc.com-pool
}
}
}
There's nothing in this iRule that would cause that. I think at this point it'd make sense to fire up a client side HTTP analyzer (ie. Fiddler or HTTWatch) and see where this information is coming from.
well, it looks like the www.abc.com/news is getting a HTTP/1.1 301 Moved Permanently and the Server: Apache(end server is IIS) then going to www.www.abc.com/ not much to go on... I used fiddler(first time)..... but in a last look I added the DNS for www.www.abc.com and funny thing... its the end server at the 3rd party.. I guess they have a rule adding www. to requests coming into there server.. I got a full website also hosted with the 3rd party. they should be recieving new.800loanmar.com/ but I dont think they are.. if Im getting that redirect.
HTTP/1.1 301 Moved Permanently
Date: Tue, 12 Nov 2013 13:50:42 GMT
Server: Apache
Location: http://www.www.abc.com/
Content-Length: 247
Connection: close
Content-Type: text/html; charset=iso-8859-1
301 Moved Permanently
Moved Permanently
The document has moved here.
Very odd that they're trying to add a "www" to something that already starts with "www". They should perhaps spend more time on DevCentral. ;)
In any case, you might be able to thwart this if you modify the Host header to them in a fashion that they'll accept without throwing a redirect.
Im going to push for them to make a new main directory under news.xxx.com/news then it will all work. Im mean really... add a www to a www.. these people need more busy work.
thanks for all the help... Its always nice to know I have people to bounce things off.