serve icon indicating copy to clipboard operation
serve copied to clipboard

`cleanUrls` not compatible with `-s` (single mode)

Open christopherthielen opened this issue 6 years ago • 3 comments

When running in -s (single mode, for SPAs), requests for files with .html extensions are redirected with the cleanUrls option (i.e., /foo.html is redirected to /foo). However, when the serve-handler code process the request for /foo, the 404 rewrite from /foo to /index.html takes precedence over the check for "related" files /foo -> /foo.html .

https://github.com/zeit/serve-handler/blob/2b8214081cfe2680f7d991ca837b0ee25e45739a/src/index.js#L244-L245

Perhaps the -s mode should disable cleanUrls option?

christopherthielen avatar Jul 21 '18 20:07 christopherthielen

Yes, please!

aaronshaf avatar Dec 07 '18 00:12 aaronshaf

Has anyone figured out a workaround for this? For now I have started adding any folders that contain static .html files to be excluded from cleanUrls but that's not wonderful.

TonyApuzzo avatar May 08 '20 00:05 TonyApuzzo

+1 this behavior isnt exactly expected

unjust avatar Feb 17 '22 22:02 unjust