Me and my team working on a final year project and we hosted our site in firebase but when we go from one page to another page it shows .html at the end of file
How It Shows:-
site.abc/Home.html
How I want:--
site.abc/Home
so how Can I hide .html, the project is in just HTML Not in PHP
CodePudding user response:
One trick is to use folders. Have a directory for each page, like Home
, and place and index.html
file inside. Then link to website.com/Home
and it will automatically serve the index page, while leaving the .html
out of the URL.
Note: This will cause a hiccup on your local machine. When you click on the link it will take you to a directory page and you'll have to manually click on the folder. But again, this only happens on local.
CodePudding user response:
It looks like you are you have links that have .html appended to them.
You need to remove that. Just have the link such as example.com/home or example.com/contact
And then you have this .htaccess rule to actually execute the .html file.
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^(?!. \.\w{2,4})(. )$ $1.html [L]