Lighttpd configuration and vue router history


Problem ๐Ÿ˜ฑ

Expected behaviour:

file_path = request.path

if file_path.is_present_on_disk():
  return open(file_path)

return open(index.html)

nginx

location / {
  try_files $uri $uri/ /index.html;
} 

But how to do it in Lighttpd?


Solution ๐Ÿค“

๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰ use url.rewrite-if-not-file ๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰

url.rewrite-if-not-file = (
     "/.*" => "/index.html"
)

Imgur