Forum Discussion
Jeremy_Dorrough
Nimbostratus
Jan 25, 2007trailing slash
Could someone please help me create an irule that will add a forward slash to the end of a url if not already there?
https://www.somesite.com/directory --> https://www.somesite.com/director...
Jan 25, 2007
Give this a shot:
when HTTP_REQUEST {
if { !([HTTP::uri] ends_with "/") } {
HTTP::uri "[HTTP::uri]/"
}
}
Now, keep in mind that this will append a slash to ALL URI's that don't end with a slash - including files with extensions/etc. If you want to mask them out then you might want to combine this with a matchclass or switch statement to mask out the uri's that you don't want to append a slash to.
-Joe
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