kevinmc
Jun 30, 2017Altocumulus
URL 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 ...
Hi 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 🙂