Forum Discussion
jgoetsch_236444
Nimbostratus
Dec 09, 2015SIngle Redirect for explicit URL
Hi DevCentral,
I'm having issues adding a simple redirect from:
Original URL: https://www.company.com/page/pagename Redirected URL: https://www.company.com/pagename/
Any help would be greatly appreciated!
Regards,
Jason
1 Reply
HI Jason,
you may try this iRule to perform the redirect.
when HTTP_REQUEST { if { ( [string tolower [HTTP::host]] equals "www.company.com" ) and ( [string tolower [HTTP::uri]] starts_with "/page/pagename" ) } then { HTTP::redirect "https://www.company.com/pagename/" } }BTW: Using a "start_with" operator to catch "/page/pagename" and also "/page/pagename/". But it will also cause "/page/pagename/foo" to become redirected. If this is not acceptable then change "starts_with" to "equals"^^
Cheers, Kai
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