index.html as default file in subfolders?
See original GitHub issueCurrently, when I open something like localhost:8080/path
, I get the fallback /index.html
file instead of an existing file /path/index.html
. Most servers, including GitHub pages, are by default configured “smartly” and return the index.html file (if it exists) when a folder is requested. Would be nice for this to be configurable, or maybe even default?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
How to open an index page into a subdirectory without adding ...
try this: fvimagination.com/testhtml the testhtml subdirectory has an index.html page inside, but the browser doesn't find that page. May it be ...
Read more >Serving index.html from a subdirectory - apache 2.2
I tried using an index. php with a redirect in document root, as well as a . htaccess redirect, but both of them...
Read more >How can the index.html file be served from a sub directory of ...
html file be served from a sub directory of the DocumentRoot without using system level links? For example: Let the document root of...
Read more >Have Subdirectory of site show the index.html file when going ...
The client now wants to have any of the subfolders of the root site show the index. html to any subdirectory sites. Example....
Read more >How to Add empty index.html from each folder and subfolder?
When surfing to any subfolder in my web site the browser displays the list of files in that directory. I would like to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
also swimming by to say this was rather unintuitive for me. using servor through svelvet, and it wasn’t obvious that this was ONLY for SPAs. i kept refreshing thinking something was wrong. expected there to be a config to serve any existing html files. so i guess count this as a “+1” haha.
usecase - making a svelte site generator, need this for local dev mode
if you’ll take a PR and/or give some specs i can try to PR - but also totally cool if you just want to keep it focused on the SPA usecase. my plan would be to add a flag, say
--indexes
like you suggest, and then modify the isRouteRequest logic and serve the correct file. Ofc if its easier for you to do it then go for it, i dont feel super confident about this stuff 😃edit: hang on… are we just slowly replicating sirv? help me get my head straight here i’m confused how they differ now apart from the zero dep/SPA only thing here
Ah, right. This is for SPA. I used servor for single-page apps and just continued to use it for regular plain old websites, didn’t even think twice. 😄