-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirect /wp-admin to /wp-admin/ as not to break the admin navigation menu #461
Comments
Come to think of it, this might be some kind of PHP.ini or http config apache thingy, where it appends a trailing slash to some paths... |
Playground in the browser handles that in the address bar handler. A better solution would involve an isomorphic WordPress request handler for all Playground consumers. |
@KeesCBakker I think so, because when I run WordPress locally with Maybe we could find the culprit in some server config and set that as a Playground default. |
|
Reopening since there is a fix in wp-now, but there isn’t yet a general fix that would work for all Playground-based apps. |
@sejas thanks for fixing this! |
The Playground client's if (requestedPath === '/wp-admin') {
requestedPath = '/wp-admin/';
}
wpFrame.src = await playground.pathToInternalUrl(requestedPath); (In packages/playground/remote/src/lib/boot-playground-remote.ts) It seems that solves the issue in general, at least on the browser side. Except for Playground-based apps that set the iframe |
@eliot-akira I was thinking about some rewriting mechanism at the request handler level to also support nice permalinks regardless of how that request reached WordPress. At the moment, building a wp-now clone would require reimplementing the rewriting logic. |
That makes sense to solve it deeper in the core, so that "consumers" like I think rewriting URL to add a trailing slash automatically is often done by server configuration. Come to think of it, it's weird that |
I am unassigning myself from this issue because I don't have the bandwidth to move it forward in the near future. |
This was fixed by #1539 in a general way here: wordpress-playground/packages/php-wasm/universal/src/lib/php-request-handler.ts Lines 360 to 370 in 093e082
|
When I use http://127.0.0.1:8881/wp-admin, I get a nice page:
But all of my links of my menu break:
So I end up on the wrong page:
Easy solution: redirect
/wp-admin
to/wp-admin/
. Looks like my "normal" WordPress does this by itself.The text was updated successfully, but these errors were encountered: