Forum Discussion
https redirection with URI Masking
.hello,
i'm new to F5 irule & need help to correct below requirement. Can someone please help us to complete https redirection with URI Masking. I have tried below irule which work for URI redirection with masking but webpage is getting converted to plain text instead greaphical view.
When user hit https://abc.com , it should be redirected to https://abc.com/abc/ but irule need to implement in such a way that it should not display the complete URL in the browser.
when HTTP_REQUEST {
Check if requested URI is / and requested host is abc.com if {[HTTP::uri] eq "/" and [string tolower [HTTP::host]] eq "abc.com" } { Rewrite URI to /abc/
HTTP::uri "/abc/"
}
}
Thanks in advance..
3 Replies
- Kevin_Davies_40
Nacreous
if {[HTTP::host] eq "abc.com"} { if {[HTTP::uri] eq "/"} { HTTP::uri "/abc/" } }The rewriting of the URI should in no way affect the content that is returned by the webserver. As long as the same content is in /abc/ then it should work fine. You may need to check your webserver configuration to ensure certain filetypes (php etc) will be recognised in the new directory because of possible security restrictions.
- Jagrut_Patil_10
Nimbostratus
i have tried with below irule, but getting same plain test page..
when HTTP_REQUEST { if {[HTTP::uri] equals "/"} { HTTP::uri "/" } HTTP::header replace "Host" "abc.com"
if {[HTTP::uri] equals "/"} { HTTP::redirect "https://abc.com/abc" } }
- Rene_Bader_1308
Altostratus
Jagrut,
please try this:
when HTTP_REQUEST {
switch [HTTP::host] {
abc.com {
if { [HTTP::uri] equals "/" }{
HTTP::uri "/abc"
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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