Is there a way to remove the ".html" extension with .htaccess using repl.it?
I tried updating my site to use an
.htaccess file to remove the
.html file extension from the URL. This did not work and I'm just getting the replit 404 pages. Here's my code:
Is there an issue with my code or does repl.it not support
.htaccess rules? If it's repl.it not allowing it, is there any way I can do this without an
.htaccess just as easily? Thanks. (I'm also wondering, if I link my repl to an actual domain will this issue still occur?)
I mean, I would just code a simple backend.
express or whatever.
But yeah, repl should add
.htaccess working. (idk if your code is wrong btw)
@GavHern Well, I would just do something simple with Flask such as
Relevant SO question: https://stackoverflow.com/questions/20646822/how-to-serve-static-files-in-flask
If you are using the code above, put all your html files in a "website" directory, all your css in a "css" directory, and all your js in a "js" directory
The only thing is that Flask is dynamic, and so your site will be slightly slower. If you really want to counteract that, I would look into https://repl.it/languages/polygott, installing nginx using
install-pkg nginx or whatever, and then customizing the command to allow
.htaccess. If you do that, and post it on https://repl.it/feedback, I'm pretty sure repl will update html/css/js repls to allow
This question is old but for any future users looking to do this - You do not have to use .htaccess files. You can just create a folder with your desired name and place into it an index.html