Forum Discussion
kevinmc
Altocumulus
Jun 30, 2017URL rewrite
I am trying to rewrite a URL for users who are using an old URL.
So if the user enters
sharepoint.abc.net
I want to redirect them to
home.sharepoint.abc.net
I have tried an irule as below ...
Stefan_Klotz_85
Cirrus
Aug 16, 2017Hi Hongster,
please try this iRule (not tested):
when HTTP_REQUEST {
if {[string tolower [HTTP::Host]] equals "sharepoint" and [string tolower [HTTP::uri]] starts_with "/blog/"} {
Change Host-Header
HTTP::header replace Location "blog.com"
Cut the first characters (based on your needs) from the URI
HTTP::uri [substr [HTTP::uri] 5]
}
}
Depending on your required logic the rule might be optimized, but it should give you an idea what you need to do here.
Ciao Stefan 🙂
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