Forum Discussion
NAWAZ_175679
Nimbostratus
Jun 13, 2018Modificatioin of irule to append www
I have my irule like this
when HTTP_REQUEST {
if { [HTTP::path] equals "/" } {
HTTP::redirect "/XYZ.Web/Login.aspx"
}
}
When user type https://www.abc.com and it works fine
but when user ...
youssef1
Cumulonimbus
Jun 13, 2018Hi Nawaz,
You right, you can use HTTP_REQUEST event to process you redirection. This event is used when the system fully parses the complete client HTTP request headers (that is, the method, URI, version, and all headers, not including the HTTP request body)...
In your case you can do it more easly:
when HTTP_REQUEST {
set hostname [string tolower [HTTP::host]]
set uri [HTTP::uri]
if { ! ($hostname starts_with "www.abc.com") } {
HTTP::redirect "http://www.abc.com$uri"
return
}
if { [HTTP::path] equals "/" } {
HTTP::redirect "/XYZ.Web/Login.aspx"
return
}
}
Regards
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