Answer the question
In order to leave comments, you need to log in
How to remove .html from the end of the address of each web page of the site?
I tried to remove .html using the .htaccess file, but due to some commands, the site either stopped working or simply removed index.html, and left shop.html and other pages ...
Answer the question
In order to leave comments, you need to log in
site.com -> home
site.com/about -> home/about/index.html
and so on
Place on the page:
<script> history.replaceState('', '', location.pathname.replace(/\.html$/i, '')); </script>
You make a folder in the main directory for each page like main -> second_page -> index.html and to go to the second page you enter an address like url.com/second_page
Religion does not allow you to use the service search?
https://qna.habr.com/q/78158
PS
In addition, there is nothing harmful for SEO or ugly in ".html" :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question