Using Clean URLs
Clean URLs can take hours of work, or massive amounts of boilerplate configuration, on other platforms or servers. Publish your site on Surge, and they will work automatically:
/hello-worldautomatically serves/hello-world.html/foo/bar/automatically redirects to/foo/barif/foo/bar/index.htmlisn’t present, but/foo/bar.htmlis/foo/barautomatically redirects to/foo/bar/if/foo/bar.htmlisn’t present, but/foo/bar/index.htmliswww.example.comautomatically redirects toexample.com, or vice versahttp://example.comcan be redirected tohttps://example.com
Clean URLs on Surge are optimised for search engines, too. These properly setup redirects ensure your pages have one, canonical source. Plus, your www URL automatically redirects to your root domain (or vice versa).
Everything published on the Surge CDN automatically gets clean URLs. To take advantage of them, publish your project.
