Forum Discussion
SharePoint Redirect To New Path Using Public Name
Hi Brian, I'm a bit confused. The SharePoint web app is listening on port 33230, but I don't see port 33230 in your switch statement or redirect location.
I'm not sure that if statements nested inside switch statements work very well. Also, it's true that HTTP::uri will change the URI before it's sent to the server, but the browser doesn't get informed of that, which can cause issues. You could use HTTP::respond in this way to accomplish the same:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "dashboards.domain.com" && [HTTP::uri] equals "/" } {
HTTP::respond 302 Location "https://dashboards.domain.com:33230/sites/BI"
}
}
I'm curious about what happens when you point dashboards.domain.com at one of your server IPs, rather than the virtual server. Same result?
Mike
- BrianG_11931Jan 27, 2014NimbostratusThanks. I have the pool member listening on port 33230. Could I accept connections on BIG-IP at port 443 and then pass them on to 33230 without having port 33230 part of the URL? Oddly I had it working without the port as part of the URL, but the graphics never appeared in the browser! I actually have some nested switching setup now as I want to handle connections on port 80 and redirect to https:// with the URI, but connections can also come in to port 443 without the URI and I redirect to https:// with the URI. Can I use this without specifying port 33230? Here's the code: when HTTP_REQUEST { switch -glob [getfield [HTTP::host] ":" 2] { "80" { HTTP::redirect "https://[HTTP::host]/sites/BI/" } "443" { switch -glob [string tolower [HTTP::uri]] { "/sites/bi/" { pool SharePoint_Dashboards_pool } "/" { HTTP::redirect "https://[HTTP::host]/sites/BI/" } } } } } Finally, what's the difference performance-wise and behind-the-scenes using "HTTP::redirect" vs "HTTP::respond 301" or "HTTP::respond 302". I thought about using one of the later two instead, but "HTTP::redirect" seems to be working fine. And is there a case where "HTTP::redirect" is preferred-to-be-used? Is "HTTP::redirect" only meant for switching between "http://" and "https://" and the like protocols? Because that's how I first learned to use it in class.
- BrianG_11931Jan 27, 2014NimbostratusOh, and do you also know if there's a sway to switch based on protocol (i.e. http:// or https://) instead of port? I researched this yesterday, but I didn't find anything.
Recent Discussions
Related Content
* 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