Ask coding questions

← Back to all posts
How to link .htacess to replit project
shrirajdash (0)

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]

xfinnbar (149)

.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:

about (folder) \
                - index.html (the file for about)

Results in: = the content of index.html.