Skip to content
← Back to Community
how can i remove the .html from my page
Profile icon
potatojs

so i have a website containing two pages for example index.html and games.html when i go to games.html, i don't want .html to appear in the url of the page how can i do it?
for example
insted of:
mywebsite.potatojs.repl.co/games.html
i want:
mywebsite.potatojs.repl.co/games

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
ADisappointment
Profile icon
potatojs
Comments
hotnewtop
Profile icon
Coder100

Hi, you can either use a backend or put it inside a folder. For example:
example.html becomes:

example/ index.html

Then you just link it:

<a href="/example">click</a>
Profile icon
potatojs

hi:)
it says page not found,
i think i didn't do it the right way can you plz :) be more specific :)@Coder100

Profile icon
Coder100

wheres the repl @potatojs

Profile icon
potatojs

eh i don't think trying to change the spaghetti code of the website is a good idea here is a simplified one:
https://repl.it/@potatojs/mywebsite#index.html
@Coder100

Profile icon
Coder100

um you didn't change anything @potatojs

Profile icon
potatojs

aha you want the changed version? ok.
https://repl.it/@potatojs/mywebsite#index.html
@Coder100

Profile icon
Coder100

change game.html to index.html :/ didn't you see what i said @potatojs

Profile icon
potatojs

nah i read it it's just hmmmnjhrbgzuvrrrbeb
thank you it worked :)
@Coder100

Profile icon
Coder100

haha no problem! @potatojs

Profile icon
ADisappointment

@Coder100 Bro i tried a lot of codes on the internet and none of them worked (probably also because i am still noob on coding), but yours worked, thanks you so much

Profile icon
Coder100
Profile icon
ShadyGames

@Coder100
I dont think this still works, I feel like I messed up my code.

Here is my code:
https://replit.com/@ShadyGames/web#home.html

I did what you said from Line 43 to Line 60, could you tell me what I did wrong

Profile icon
ShadyGames

@Coder100
My repl isn't working
https://replit.com/@ShadyGames/web#index.html

Could you to tell me what I did wrong?

Profile icon
aanginer

none of these work for me. the 1st because i have a navbar and the 2nd one just wont work. is there any reason it isnt working?

the url to my repl is: https://replit.com/@aanginer/coolcode#index.html

Profile icon
InvisibleOne

You need to write a thingy that removes the .html. Check out this https://teamtreehouse.com/community/removing-html-from-url

Profile icon
potatojs

is there a simpler way?
@BrownieBoi

Profile icon
InvisibleOne

I don't know of one @potatojs

Profile icon
InvisibleOne

This guy seems to know what he's talking about https://www.youtube.com/watch?v=-6LyG9I-FPc @potatojs

Profile icon
potatojs

ok :(
thanks :)@BrownieBoi

Profile icon
potatojs

yeah i found it to, but i'm waiting for coder100 that seems to have a simpler way, if not i'm going to use that one :[email protected]