Forum Discussion
SIngle 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
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