Forum Discussion
Mike_Graston_10
Nimbostratus
Dec 04, 2006Redirects or appends
I was wondering I have about 20 or so redirects for urls because my development team will not put them on the servers. If a uri does not have a / at the end of it would it be possible to append this with an Irule? I tried look at this and I am using the http redirect for this and sending a redirect with the / after the uri.ex
user request the following
https://mydomain.com/app1
I use the redirect to
https://mydomain/app1/
Of course this sets up 10 -15 per site
I would like to say any url that doesn't end with / append / how ever this would cause problems for legit uri'd not needing the / at the end like ig the application sends back
https://mydomain.com/app1/loging.asp
etc...
- hoolio
Cirrostratus
It sounds like you're unsure of what methodology to use for determining when to change the URI. If it's a relatively small, known list of URIs you want to redirect, you could define them in a class and then rewrite the URI or redirect based on the class definition.class uris_to_redirect { "/app1" "/app2" "/another_uri_to_change" }
when HTTP_REQUEST { if { [matchclass [string tolower [HTTP::uri]] equals $::uris_to_redirect] }{ HTTP::redirect "http://[HTTP::host][HTTP::uri]/" } }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects