Forum Discussion
Justin_Kalb_440
Nov 08, 2010Nimbostratus
Irule to change page extension
Sorry this is a total noob post and if i am reposting please bear with me.
I am completely new to rewriting and in a situation where i am not able to directly interface with the f5. I am working with the following code:
when HTTP_REQUEST { if { [HTTP::uri] contains ".php" } { HTTP::redirect [HTTP::host] [HTTP::uri [string map -nocase {".php" ".html"} [HTTP::uri]]] }
The intent is to remap all resuests for http://someserver.com/somepage.php to http://someserver.com/somepage.html. Can anyone shed light on the simplest way of making this redirect?
Thanks
Justin
- George_Watkins_Historic F5 AccountHi Justin,
when HTTP_REQUEST { if { [HTTP::uri] contains ".php" } { HTTP::redirect http://[HTTP::host][string map -nocase {".php" ".html"} [HTTP::uri]] } }
- hooleylistCirrostratusAs George suggests, LTM VE would be a great way to test this.
when HTTP_REQUEST { if { [HTTP::path] ends_with ".php" } { HTTP::uri [string map -nocase {".php" ".html"} [HTTP::path]] } }
- Justin_Kalb_440NimbostratusAaron / George,
- Justin_Kalb_440NimbostratusAaron / George,
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