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/

https://www.abc.com/gfg/sss/

https://www.abc.com/tkt/bbb/

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. HTTP::redirect

 

If you just wish to re-map URI: HTTP::uri

 

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]" ?]
    }
}