Remove .html extension

Hello,

I am using the bootstrap studio sites hosting and I want to remove the .html extension after the url.
Can someone help me do that?

To do this you will need edit your .htaccess file and remove the .html extension from the urls in your bsdesign project.

Note: this will work when you have exported and published on your own server but won’t be supported Natively within the app nor will it be supported with bss hosted websites.

Search the forum. The subject has been discussed about eleventy billion times.

The only way I can think to do this is to put each page in a separate folder and rename it to index.html
This would work on smaller sites, but could get a bit confusing on large sites

So your structure would look something like this:

index.html (Homepage)
|
|_About (folder)
| Index.html
|
|_Services (folder)
| Index.html
|
|_Contact (folder)
| Index.html

Then change all your links to just the folder (href = ‘/about’) etc

To get back to the main index use ./ (or an absolute path)

Create a file called .htaccess at the root of your website.
Note the entire filename is “.htaccess” (without quotes), not “somename.htaccess”.

Add the following lines of code to it:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.html [NC, L]

Save it (again at the root - probably where your index.html file exist).

You should be able to browse to the site without specifying .html as part of the url.

If it doesn’t work, talk to your admin (i.e., hosting tech support). Good luck.