Ask coding questions

← Back to all posts
How to link .htacess to replit project
h
shrirajdash

I am making a website and I am trying to remove the .html from all my web pages by adding the .htaccess file but seems o not work.
Here is my .htaccess code.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [NC,L]

Voters
shrirajdash
Comments
hotnewtop
xfinnbar

.htaccess does not work on replit, but to achieve the same effect you can create a folder with the name of your page, then put an index.html file in it:

Results in: yoursite.com/about = the content of index.html.