Forum Discussion
URI redirection
Hi all,
I have a requirement to redirect the URI which is not used in our application. We get lot of 404 errors in our apache logs as this URI is bookmarked by the users.
Actual application URL:https://uat-app.xx.com/ep/faces/index.jspx
Old application URL:https://uat-app.xx.com/km/faces/index.jspx
If a user access the URL https://uat-app.xx.com/km/faces/index.jspx or URI /km it should redirect to https://uat-app.xx.com/ep/faces/index.jspx. i am putting the irule which i am going to implement. Please let me know if that will work or not.
if {[HTTP::uri] starts_with "/km" }{
HTTP::redirect https://uat-app.xx.com/ep/faces/index.jspx
}
- nitassEmployeei think making it more specific might be better. anyway, it is not a big deal.
if {[HTTP::uri] eq "/km/faces/index.jspx" }{ HTTP::redirect https://uat-app.xx.com/ep/faces/index.jspx }
- jacky_70451NimbostratusThanks for the quick response nitass.. so what will happen if a user access the URL https://uat-app.xx.com/km/ will that redirect to the actual application page
- nitassEmployeewhat will happen if a user access the URL https://uat-app.xx.com/km/ will that redirect to the actual application pageno. in that case, you have to use your original irule.
- ArieAltostratusYou may want to use a 301 (permanent redirect) rather than a 302 (temporary redirect).
HTTP::redirect results in a 302. If you want a 301 you'll need to use:
HTTP:: respond 302 Location http://destination
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