Skip to content

[BUG] Category URLs with trailing slash return 200 instead of 404 or 301 #4741

Open
@empiricompany

Description

@empiricompany

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Category URLs are also accessible with a trailing slash.

For example:
https://github-openmage.loc/women.html

If I add a trailing slash:
https://github-openmage.loc/women.html/

The page should return 404 or a 301 redirect to the correct canonical URL, but instead, it returns 200.
PS: The canonical URL is always set correctly: https://github-openmage.loc/women.html

Expected Behavior

Accessing a category URL with a trailing slash must redirect with a 301 to the correct canonical URL.

Instead, the page returns a 200 OK response, even though the canonical URL is correctly set.

Steps To Reproduce

  1. With this settings:

1

2

  1. Manually add a trailing slash to a category url

Environment

- OpenMage: 20.14.0 
- php: 8.2

Anything else?

If I search in URL Rewrite Management, there is no URL with a trailing slash.

3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions