Forum Discussion
Babar_Ansari
Jun 03, 2021Nimbostratus
url rewrite request
I need to perform url rewrite wherein my original url will be https://abc.com and its subdirectories as well like https://abc.com/abc or https://abc.com/abc/xyz My requirement is to add www before t...
spalande
Jun 04, 2021Nacreous
Rewrite is on the serverside of the session, which is from the F5 to the backend server and it won't be visible to the clients on browsers. If you need a rewrite of the HOST header on the serverside of the session you can use below iRule
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if {$host eq "abc.com"}{
HTTP::header replace "Host" "www.abc.com"
return
}
}
Redirect is a is a client-side request to have the web browser go to another URL. This means that the URL that you see in the browser will update to the new URL. If you are looking for a redirect, below is the iRule
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if {$host eq "abc.com"}{
HTTP::respond 301 Location "https://www.abc.com[HTTP::uri]"
return
}
}
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