How Do I Remove The **.html** In My Website?

Hello, I was wondering how I can hide/remove the .html in my website’s address bar.

Example:
What I Want: www.tikogrant.tk/index
My Current Website: www.tikogrant.tk/index**.html**

I looked at other posts on support.glitch.com and found some people answering my question, but… it didn’t work :frowning: sadly.

If someone could answer my question with some lines of code that work for Glitch.com, that would be greatly appreciated!

Hi, one simple way to do this is to replace all your html file names with originalname/index.html. When you go to yoursite.glitch.me/originalname, it will show the file at originalname/index.html. You could also make it a full stack app, but that requires a lot of changes that I am too lazy to explain here.
Edit: I just saw that you found your answer in another topic that says essentially the same thing as I just said :slight_smile:

3 Likes

You can’t use code to do this. Make a folder and put your file in there. Rename it to index.html. It should work!

You can actually, by writing a bash script and then execute it in the terminal.

There’s a command for that?

I suppose you could just run:

mkdir index && cp index.html /index && rm index.html

That is true, haha. I thought there was a single command.

Well…

alias move="mkdir index && cp index.html /index && rm index.html";

no like:

mvmdkir index.html index/

that’d be pretty cool

1 Like

Thanks Everyone, It Helped! :slight_smile:

2 Likes

Use this one liner to remove .html:

alias moveFile="mkdir $1;mv $1.html $1;cd $1;mv $1.html index.html"

I think it should work.

1 Like