How to remove .html from website URLs?

For stripping html from url I use the following:

.htaccess file content

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^.*$ $0.html [L,QSA]
RewriteCond %{THE_REQUEST} ([^\s]*)\.html(\?[^\s]*)?
RewriteRule(.*) %1 [R=301,L]

The contents of the index.html file
<a href=”/myjobs”>My Works</a>

If I put a trailing slash in the name of myjobs.html file. Example my_jobs.html
Then the page will not load.
What needs to be written in .htaccess in order to remove html from the url for such files with a lower slash as my_jobs.html ??

Leave a Reply

Your email address will not be published. Required fields are marked *