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.

URLs to .html without trailing slash and redirect

See original GitHub issue

I have some routes that are pretending directly pointing to html files:

routes: [ 
...
  'pages/1.html',
  'pages/2.html',
...
]

and prerender-spa-plugin produces directory structure as:

pages/
└─1.html/
  └─index.html
└─2.html/
  └─index.html

The problem is that most of static web servers with such structure will issue a redirect from pages/1.html to pages/1.html/. Is there a way to specify output file per route to get structure like this?

pages/
└─1.html
└─2.html

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
JoshTheDerfcommented, Apr 17, 2018

Hmm, good idea. Perhaps I could add some logic to avoid outputting routes if there is a file extension on the route?

0reactions
noscriptcommented, Apr 25, 2018

Works perfectly! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should You Have a Trailing Slash at the End of URLs? - Ahrefs
A trailing slash is a forward slash (“/”) placed at the end of a URL such as domain.com/ or domain.com/page/. But should you...
Read more >
To slash or not to slash | Google Search Central Blog
This behavior is beneficial because it reduces duplicate content. In the particular case of redirects to trailing slash URLs, our search results will...
Read more >
Trailing Slashes on URLs: Contentious or Settled? | CSS-Tricks
You can enable uglyURLs = true and redirect all “*.html” ugly URLS to the correct paths (without trailing slashes or .html ) but...
Read more >
URLs Without Trailing Slash or Extension (Nginx, Apache)
I prefer URLs without a trailing slash or an extension when they are pointing to pure html content. They get the information across...
Read more >
301 redirect urls with trailing slash to urls ... - Stack Overflow
Right -- if you request just the host with no path, the browser appends '/', so you end up with an infinite redirect....
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