Forum Discussion
Rewrite URL iRule
I have used redirect before and they have worked but can't get this rule to work.
When a user browses to abc.co.uk i want to change the URL in the browser bar to www.abc.co.uk. i have tried the following without success:
when HTTP_REQUEST {
if { [HTTP::host] equals "skipton.co.uk/" } {
HTTP::header replace "Host" "https://www.skipton.co.uk/"
}
}
*with the / on the end
when HTTP_REQUEST {
if { [HTTP::host] equals "skipton.co.uk"}
{ HTTP::header replace Host "www.skipton.co.uk"
}
}
*without the / on the end
when HTTP_REQUEST {
if { [HTTP::host] equals "skipton.co.uk" } {
HTTP::redirect "https://www.skipton.co.uk[HTTP::uri]"
}
}
Can anyone see why it does not work and how to fix it? Much appreciated.
,
Below iRule looks good, it should work.
when HTTP_REQUEST {
if { [HTTP::host] equals "skipon.co.uk" } {
HTTP::redirect "https://www.skip.co.uk[HTTP::uri]"
}
}
Check under iRule statistics if you are seeing hits to it.
Mayur
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