Removing extensions

Can someone tell me how to remove the .html extension from my website? For eg. link.domain/site.html to link.domain/site
Also how can I hide assets from being accessed? By doing link.domain/assets, anyone can access the files in the assets folder.

Huh! I am getting a 404 when I add /assets onto the domain on my projects. Is your project a static website project? I’ll test it on a static site and see if I’m getting that result!
One way you can remove the .html extension is to serve the project using express! You can define the routes and what will be returned to the client that way.

I’m not sure whether my site is static or dynamic because I have a live chat script on my website and I don’t know if that makes the site dynamic

Hey @househaunt @Infinity1231,

I also got a Not found when I added /assets on a static site. Is it possible for @Infinity1231 to give us the link of the project?

Yes, here’s the link: site-gaming-inc.glitch.me or www.gaminginc.tk

/assets is not a real folder, it’s a hologram

The files are stored on a cdn separate to the project, the list of urls are in a hidden file .glitch-assets

Anyone can literally download the images I used by accessing the /assets thingy so how can you say it’s a hologram?

Huh! I looked at the site and I see what you mean! I think that there’s a way to configure this via express. I think your project might be set to “private” – if you feel comfortable making it public, or sending me an invite link via DM, I’d be happy to take a look into it!

1 Like

Or it could be possible that there is actually a folder named assets. Sharing a screenshot of the project file tree could also help.

Yes, there is a folder named assets

This is my thinking also – if so, I think there’s probably a way with express to make it available to the code, but not as transparently available to a casual user?

Should I send a screenshot of the project file?

Actually, assets gives me a directory, which indicates that it should be a folder. @Infinity1231, could you please share a screenshot of the project file tree?

Oh yeah! The assets were stored in a new folder called assets, instead of Glitch’s virtual folder! And that new folder was a public folder, just like the rest of the project. To prevent the images to be seen publicly, you need to add the images in the first assets folder, that has a picture of a box, which is entirely private!

Will there be any error because the images are in a different assets folder?

And then you can reference the images with the URL they give.

Ahhhh yeah, and it’s a static website. Hmm… I feel like the containers underlying the static sites might actually be different from the ones with a backend. It might be worth remixing an express project and moving the assets over if you’re up for it @Infinity1231

1 Like

@househaunt,

That is a good idea!

Do I need to change reference for all the images?