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.

What I Want:
My Current Website:**.html**

I looked at other posts on 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, 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, 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:


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.


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:


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