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:
/foo/bar/automatically redirects to
/foo/bar/index.htmlisn’t present, but
/foo/barautomatically redirects to
/foo/bar.htmlisn’t present, but
www.example.comautomatically redirects to
example.com, or vice versa
http://example.comcan be redirected to
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.