Forum Discussion
URL rewriting
Hi, I am redirecting a request using iRule from inside my network to the Internet , in the iRule I am using public ip address of my public server , the url appear to all users like the following: /HomePage/index.html how to replace this Public IP-address with a name , for some reasons I can't use the original name, I want to be like this /HomePage/index.html is it possible or not. Regards,
4 Replies
- Mouene_240365
Nimbostratus
Sorry I meant to be like this -->> name/HomePage/index.html This is what I am curenlty using:
when HTTP_REQUEST { HTTP::redirect }
- IheartF5_45022
Nacreous
This might be what you need (the requirements weren't very clear);-
when HTTP_REQUEST { if {[HTTP::path] eq "/"} { HTTP::respond 301 Location "http://[HTTP::host]/HomePage/index.html" return } }- Mouene_240365
Nimbostratus
Thank you for your reply , unfortunately this does not answer my question. I have the following iRule : when HTTP_REQUEST { HTTP::redirect } This iRule redirect users to the Internet , the public IP address that I used in this iRuel appears in the url in the browser after redirecting ex.:
My questin is how to hide this ip or replace it with any other name to be like the following:
Thanks,
- IheartF5_45022
Nacreous
Is this what you need? Sorry still unclear on requirement.....
when HTTP_REQUEST { if {!([HTTP::Host] eq "anyname.com")} { HTTP::respond 301 Location "http://anyname.com/HomePage/index.html" return } }
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