Skip to content

Redirect to canonical subsite/slug for post#61

Merged
csebianlander merged 1 commit intomainfrom
57-post-urls-require-the-title-slug
Jul 28, 2025
Merged

Redirect to canonical subsite/slug for post#61
csebianlander merged 1 commit intomainfrom
57-post-urls-require-the-title-slug

Conversation

@wrose504
Copy link
Collaborator

@wrose504 wrose504 commented Jun 29, 2025

As noted in #57 and #58, it would be good for the PostController to redirect to the canonical URL even when the slug is not provided, or is incorrect.

@wrose504 wrose504 requested a review from kirkaracha June 29, 2025 17:45
@wrose504 wrose504 self-assigned this Jun 29, 2025
@wrose504 wrose504 linked an issue Jun 29, 2025 that may be closed by this pull request
@wrose504 wrose504 marked this pull request as draft June 29, 2025 17:46
@wrose504
Copy link
Collaborator Author

Oops ok it clashes with other routes like /create, let's see if that is fixable.

@wrose504 wrose504 force-pushed the 57-post-urls-require-the-title-slug branch from 4ec1d81 to dcd933b Compare June 29, 2025 17:59
@wrose504 wrose504 marked this pull request as ready for review June 29, 2025 17:59
@wrose504
Copy link
Collaborator Author

Ok that's better. I think this might also address #53 as the canonicalization works after creating a new post, too.

@wrose504 wrose504 force-pushed the 57-post-urls-require-the-title-slug branch 3 times, most recently from 2ab453a to 10c0f01 Compare July 5, 2025 17:09
@wrose504 wrose504 force-pushed the 57-post-urls-require-the-title-slug branch from 10c0f01 to 4eb9563 Compare July 16, 2025 02:09
@Anna-M-Thomas
Copy link
Collaborator

Thank you for your patience, I took a look at the code and it looks OK to me. Checked in local it works as intended: when I remove a post's slug or replace it with nonsense, it redirects to the canonical URL.

@csebianlander csebianlander merged commit 6589e0e into main Jul 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post URLs require the title slug

3 participants