question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serving name.html files under /name as well as /name.html ?

See original GitHub issue

Any plans to support serving static html files on their “basename path”? That is for example http-server, github pages, and others, serve .html files both under /name.html and /name by default, so the index page would be accessible at:

  • /
  • /index
  • /index.html

And a non-index page at:

  • /page
  • /page.html

For me specifically I need to save my html files with an .html extension, serve them as simply as possible (static folder serve), and view them through an URL without the .html extension (since it’s cleaner and a common pattern for wikis).

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tjcommented, Dec 29, 2015

duplicate content? maybe as an option, but this will be bad for SEO as a default unless it’s a redirect (maybe as separate middleware or rewrite)

0reactions
nicluocommented, Jan 25, 2017

I’m using koa v2, koa-static v3, koa-mount v2, it just works right out of the box. 😃

app.use(mount('/public', serve('public', {extensions: ['.html']})));

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rules to Follow When Naming HTML Files - ThoughtCo
Naming your HTML files is important, but there are some conventions you should use when choosing what to name your files.
Read more >
Guidelines for Naming HTML Files and Folders
File names and folder names should contain only letters, digits, and underscores—no spaces, punctuation, or funny characters. We want to really ...
Read more >
Links in HTML documents - W3C
The destination anchor of a link may be an element within an HTML document. The destination anchor must be given an anchor name...
Read more >
How to set name of file downloaded from browser?
My question is, is there any way to specify the name of a file to be downloaded using just HTML? So a user...
Read more >
Basic HTML: Naming Web Files - Rootsweb
Brief tutorials on the basics of writing HTML.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found