Skip to content

Fix stage switcher URLs when WordPress is installed in a subfolder - #30

Merged
retlehs merged 1 commit into
masterfrom
fix/subfolder-url-translation
Mar 9, 2026
Merged

retlehs merged 1 commit into
masterfrom
fix/subfolder-url-translation

Conversation

@retlehs

@retlehs retlehs commented Mar 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Strip the current environment's base path from the request URI before appending to target environment URLs
  • Use runtime site_url() path as primary prefix, with ENVIRONMENTS config path as fallback
  • Prevent partial segment matches (e.g. /wp no longer incorrectly matches /wp-json)
  • Preserve query strings during URL translation

Closes #14

🤖 Generated with Claude Code

Closes #14

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@retlehs retlehs self-assigned this Mar 9, 2026
@retlehs
retlehs merged commit c3373b8 into master Mar 9, 2026
5 checks passed
@retlehs
retlehs deleted the fix/subfolder-url-translation branch March 9, 2026 21:41
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.

Bug when WP is installed in a subfolder

1 participant