How to remove [.html]
When I have another page in my website it would be
https://example.com/meme.html
How do I remove the .html
?
rght now you are using static hosting which means it will just serve all your files as if it is a directory. in order to remove the .html
you will need to use a router which is a bit more complex but very doable. You can see some examples in the websites I have made in the past:
https://repl.it/@MrEconomical/ecocode
https://repl.it/@MrEconomical/eco-studios
@MrEconomical what's the code to remove file extensions???
Why do you want to get rid of the file extension from meme.html? What you have made is a web server using node and it is set up to serve files from the static folder. These files can use hyperlinks rather than javascript code to navigate between pages. For example instead of having the following in an HTML page: <button onclick="window.location.href='news.html'" class="button buttond" id="calm button">Inspiring News | Wholesome News to make your DAY!</button><br />
, you can use: <a href="news.html">Inspiring News | Wholesome News to make your DAY!</a>
@malvoliothegood because i want to keep it as a blue button, not text
@Purple01Flame You can style a link so it looks just like a button: https://css-tricks.com/css-basics-styling-links-like-boss/
@malvoliothegood no thanks
@Purple01Flame all you have to do is create a folder named meme and put index.html in there then the index.html will show up on pageurl/meme