Forum Discussion
Chris_Robert_10
Nimbostratus
Sep 15, 2006URL rewrite plus
I currently have this iRule running:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/www.mysite.com/" } {
HTTP::uri "/www.mysite.com/index.htm/"
}
}
...
Eric_Grepps_264
Nimbostratus
Oct 02, 2006I am stumbling with the same issue. I need to add "www" only if the person did not enter it as the host.
I am starting with the following iRule.
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect https://[HTTP::host]/login.do
} else {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
I am using the above rule as a generic redirect across 20 or so domain names. I only need to place the www in front if the HTTP::host only contains a root domain name.
For example I need the following to occur:
http://domain.com --> https://www.domain.com
http://host1.domain.com --> https://host1.domain.com
http://host5.site1.domain.com --> https://host5.site1.domain.com
Any help would be greatly appreciated.
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