Skip to content

Remove redundant 301 redirect headers before 404 in editor include - #628

Merged
uldisrudzitis merged 1 commit into
masterfrom
fix/editor-404-redirect-header
Aug 31, 2026
Merged

Remove redundant 301 redirect headers before 404 in editor include#628
uldisrudzitis merged 1 commit into
masterfrom
fix/editor-404-redirect-header

Conversation

@uldisrudzitis

@uldisrudzitis uldisrudzitis commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

The 301 status/Location headers were always overwritten by the subsequent include of error/404.php, which sets its own 404 status. The Location header was left dangling on the final 404 response with no effect, since browsers only act on it for 3xx/201 responses.

Summary by CodeRabbit

  • Bug Fixes
    • Requests for unrecognized sections now display the standard 404 error page instead of redirecting to the site or engine homepage.

The 301 status/Location headers were always overwritten by the
subsequent include of error/404.php, which sets its own 404 status.
The Location header was left dangling on the final 404 response with
no effect, since browsers only act on it for 3xx/201 responses.
@uldisrudzitis uldisrudzitis self-assigned this Aug 30, 2026
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d7e515b-eb4b-46b8-aef8-d39f67b8d75b

📥 Commits

Reviewing files that changed from the base of the PR and between 531a0ef and a1d6a95.

📒 Files selected for processing (1)
  • engine/editor/inc.editor.php
💤 Files with no reviewable changes (1)
  • engine/editor/inc.editor.php

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The editor now sends mismatched section requests directly to 404.php. It no longer issues a 301 redirect to the site or engine root URL.

Changes

Section error handling

Layer / File(s) Summary
Route mismatched sections to 404
engine/editor/inc.editor.php
Removed the environment-dependent 301 redirects. Mismatched section requests now include 404.php and exit.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to a1d6a

This localized change removes redundant redirect headers from the editor's final 404 response; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removing the redundant 301 redirect headers before loading the 404 page in the editor include.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/editor-404-redirect-header

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@uldisrudzitis
uldisrudzitis merged commit 8ecb92f into master Aug 31, 2026
5 checks 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.

1 participant