Hi!
How do I remove .html in the URL on exported sites?
Thanks!
Hi!
How do I remove .html in the URL on exported sites?
Thanks!
Take a look at this!
I created a GitHub Action to fix this undesirable, broken behavior of Webflow’s export:
Fixes all the paths in all the files and then commits them
Awesome - this exact item was on my action list to sort next week!
Thanks for sharing this, I’ll definitely be going through this properly soon.
So I got round to looking at this today, and ran it on a site I had at the time. It’s certainly really helpful so thanks again for sharing.
It’s not something I have any experience in, so I may have to look a little closer at this but I’m interested in knowing whether this can also 1) restructure the files into the relevant directory names, 2) change the files to index and 3) whether the original index.html can be handled in such a way that it’s left alone and the links point to root?
Or have I missed a trick here?
Thanks
@iratefox not sure I’m understanding what you mean… do you mean that you want to create directories matching the filenames and add the files to them?
Eg:
about-us.html → about-us/index.html
This is not a part of the script - my free host Netlify (highly recommended) will serve the about-us.html
file as /about-us/
But if your host does not do this and you cannot switch to one that does, then you can modify the script on / after these lines here (these lines do a find and replace in all files to fix the paths). Each line that you write after these lines will be run as a “bash script”. So in case you don’t know what that is, you can google for how to do the thing you want in bash
Thank you - I was working on this just now and concluded that there’s more to it at host side. I am now using this in combo with a .htaccess file which is a good combo and handles everything as expected.
Great, glad to hear it! Mind posting the relevant parts of the .htaccess file that you’re using?