Skip to content

hugo server should check for /foo.html when requesting /foo #2242

Closed
@octref

Description

@octref

I'm using https://surge.sh/ to deploy my hugo site. It has a great clean url feature, so if you have /foo.html, /foo will get it, /foo/ will redirect to /foo.

So now I'm creating content/foo.md, and enabling uglyurls so hugo generates /foo.html.

In some pages, such as listing page, I'm now using {{ trim .RelPermalink ".html" }} to use clean url in href. However, this causes problem with hugo server. A request of /foo doesn't check the existence of /foo.html, but directs to /foo/ to try /foo/index.html immediately.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions