Forum Discussion
Uri rewrite with [seo remove index.html]
Hi Guys, This is my first time at DevCentral.
I want to rewrite this uri with variable
The user request are :
https://www.abc.com/application/xxxxxx/index.html
https://www.abc.com/gfg/sss/index.html
https://www.abc.com/tkt/bbb/index.html
and i want to rewrite to 301 :
https://www.abc.com/application/xxxxxx/
just remove index.html
thank you.
You can redirect with 301 code as per note in this article: HTTP::redirect - Redirects an HTTP request or response to the specified URL. https://clouddocs.f5.com/api/irules/HTTP__redirect.html
 
If you just wish to re-map URI: https://clouddocs.f5.com/api/irules/HTTP__uri.html
 
- Stanislas_Piro2
Cumulonimbus
Hi,
you can use following code :
when HTTP_REQUEST { if {[URI::basename [set uri [HTTP::uri]]] equals "index.html"} { HTTP::respond 301 Location [join "[URI::path $uri] [URI::query $uri]" ?] } }
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