Forum Discussion
iRule for https redirect - redirects every URL back to homepage
I've setup an iRule to redirect https://www.aibgb.aibtest.ie to https://aibgb.aibtest.ie. The problem is that when I try to access https://www.aibgb.aibtest.ie/ibhelp it gets redirected to https://aibgb.aibtest.ie instead of https://aibgb.aibtest.ie/ibhelp
What do I need to modify in my iRule so it keeps the additional folder suffixes and not direct every URL with the domain name in it back to the homepage as it is currently doing?
Here is my irule;
when HTTP_REQUEST { if { ([HTTP::host] equals "www.aibgb.aibtest.ie") } { HTTP::redirect "https://aibgb.aibtest.ie" } }
4 Replies
- nathe
Cirrocumulus
What about something like this:
when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "www.aibgb.aibtest.ie" } { HTTP::respond 301 Location "https://aibgb.aibtest.ie[HTTP::uri]" } }See if this works for you.
N
- nolipineda
Altostratus
Add [HTTP::uri] to your redirect.
- Anuj_Chaudhary_
Nimbostratus
yes right Add [HTTP::uri]
- Internet_Suppo1
Nimbostratus
I tried this but it didn't work for me.
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