Forum Discussion
irule for URL redirection and response content patience page
Dear Team, We have a URL which was decommissioned. However we didnt want to inform the users regarding the change of URL since it is kept as favourite for entire users.
DNS entry for decommisioned website was abc-uat-int.domain.ae DNS entry for new New website is pointed to abc-uat.domain.ae
so we created a Irule for URL redirection from abc-uat-int.domain.ae to abc-uat.domain.ae
Step 1: In the HTTP Virtual IP of old website abc-uat-int.domain.ae , We configured Irule as below: when HTTP_REQUEST { HTTP::redirect "https://abc-uat.domain.ae[HTTP::uri]" } Now redirection is happening properly as desired. However our requirement is, whenever user try to enter the old URL abc-uat-int.domain.ae, they should get a website patience page for 5 secs with an message Respond header should give message before the URL gets redirected from abc-uat-int.domain.ae to abc-uat.domain.ae "We are sorry, but the site you are looking for has been moved on https://abc-uat.domain.ae."
Please do the needful as i am not really sure of how to write irules for website respond content messages.
Thanks, Vish
7 Replies
- nitass
Employee
you can send meta-refresh using HTTP::respond command.
irule to pop up a window then continue to page
https://devcentral.f5.com/questions/irule-to-pop-up-a-window-then-continue-to-page- Arie
Altostratus
I would recommend not using a meta-refresh since it's not (100%) reliable. In addition, it doesn't instruct clients (and search engines) to start using the new URL (like a 301 would). My recommendation for this situation would be to issue a 301 and then intercept the request to the new location (check the HTTP header "referer" for the referring (old) URL) to show the pop-up. That way you can have the 301 as well as the message to the visitor.
- nitass_89166
Noctilucent
you can send meta-refresh using HTTP::respond command.
irule to pop up a window then continue to page
https://devcentral.f5.com/questions/irule-to-pop-up-a-window-then-continue-to-page- Arie
Altostratus
I would recommend not using a meta-refresh since it's not (100%) reliable. In addition, it doesn't instruct clients (and search engines) to start using the new URL (like a 301 would). My recommendation for this situation would be to issue a 301 and then intercept the request to the new location (check the HTTP header "referer" for the referring (old) URL) to show the pop-up. That way you can have the 301 as well as the message to the visitor.
- Arie
Altostratus
issues a 302 (Temporary Redirect). Since the URL has been decommissioned you will want to use a Permanent Redirect (301). Permanent redirects will instruct clients and search engines alike to go directly to the new location in the future.HTTP::redirectTo get the iRule to issue a permanent redirect use:
HTTP::respond 301 Location "http://www.newdomain.com/newpath" - Vishakh_Krishna
Nimbostratus
Requirement is as below"
When user types abc-uat-int.domain.ae, HTML holding webpage should appear with an message "We are sorry, but the site you are looking for has been moved on https://abc-int.domain.ae." for 5 seconds and then it should redirect to abc-int.domain.ae.
Redirection is happening perfectly fine. just need a HTML holding page for 5 seconds with above message before it redirects. Please assist. I got some sample irule. Please let me know if it will work.
when HTTP_REQUEST {
HTTP::respond 302 content \"Apology pagehttp://www.domain.com/aba/>\
We are sorry, but the site you are looking for has been moved on https://obs-uat.domain.ae." "Content-Type" "text/html" set dtime 5 }
- StephanManthey
Nacreous
Hi Vishakh,
you can check the following thread for a potential solution, please:
https://devcentral.f5.com/questions/redirect-a-vs-via-irule
Thanks, Stephan
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