Skip to content

fix(plugin-client-redirects): Improve redirection handling with window.location.replace 🔗 - #12304

Open
sanjaiyan-dev wants to merge 4 commits into
facebook:mainfrom
sanjaiyan-dev:sanjaiyan-redirect-fix
Open

fix(plugin-client-redirects): Improve redirection handling with window.location.replace 🔗 #12304
sanjaiyan-dev wants to merge 4 commits into
facebook:mainfrom
sanjaiyan-dev:sanjaiyan-redirect-fix

Conversation

@sanjaiyan-dev

@sanjaiyan-dev sanjaiyan-dev commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Hi,

This PR contains a small fix to improve our redirect handling:

  • Updated redirect method: Switched from window.location.href to window.location.replace() to avoid cluttering the browser's history stack.

Back Button Behavior: If a user visits Page A → Page B (Redirect Page) → Page C, clicking the browser's "Back" button on Page C takes them directly back to Page A.

  • Improved HTML semantics: Moved the redirect script inside the <head> tag for better HTML structure and faster execution.

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Extremely sorry if I made any mistakes.

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label Jul 21, 2026
@netlify

netlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 654a021
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a5fb37038d39a000824543d
😎 Deploy Preview https://deploy-preview-12304--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant