Forum Discussion
mohdemraan_1691
Nimbostratus
Sep 05, 2014Need to retain case sensitive in uri
Hi All,
I have a request to retain case sensitive in uri path like this: http://mysite.com/ThisFolderPath/v1
if someone may try something like this: http://mysite.com/thisfolderpath/v1 then it should need to be redirected to my URL which case sensitive. also the v in second uri should be in small.
can someone help please ?
2 Replies
- nitass
Employee
not sure if i understand correctly. is it something like this?
config [root@ve11a:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when RULE_INIT { set static::uri "/ThisFolderPath/v1" } when HTTP_REQUEST { if { [string match -nocase $static::uri [HTTP::uri]] } { if { [HTTP::uri] ne $static::uri } { HTTP::redirect "http://mysite.com${static::uri}" } } } } test [root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/thisfolderpath/v1 HTTP/1.0 302 Found Location: http://mysite.com/ThisFolderPath/v1 Server: BigIP Connection: Keep-Alive Content-Length: 0 [root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/THISfolderpath/v1 HTTP/1.0 302 Found Location: http://mysite.com/ThisFolderPath/v1 Server: BigIP Connection: Keep-Alive Content-Length: 0 [root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/ThisFolderPath/v1 HTTP/1.1 404 Not Found Date: Fri, 05 Sep 2014 14:53:01 GMT Server: Apache/2.2.3 (CentOS) Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT ETag: "41879c-59-2a9c23c0" Accept-Ranges: bytes Content-Length: 89 Content-Type: text/html; charset=UTF-8 - Kevin_Stewart
Employee
The HTTP::uri command is case sensitive, so you could very simply do something like this:
when HTTP_REQUEST { if { [HTTP::uri] ne "/ThisFolderPath/v1" } { HTTP::redirect "http://[HTTP::host]/ThisFolderPath/v1" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
