Welcome! Log In Create A New Profile

Advanced

Removing .html extension and index.html on website url

Posted by edave 
Removing .html extension and index.html on website url
June 21, 2021 11:38AM
Need to remove the html extension from a site's index.html, for instance, the home page should be rendered as www.abc.com and not www.abc.com/index.html. And for the remaining pages, for instance www.abc.com/contact.html should be rendered as www.abc.com/contact.

Nginx strongly recommends not to use the 'if' directive but a 'return' directive and 'rewrite' as a last resort.

How can we do it the right way?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 188
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready