-
Notifications
You must be signed in to change notification settings - Fork 274
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
sitemap plugins don't work with playground #1186
Labels
[Type] Enhancement
New feature or request
Comments
@rhildred how is this different from normal PHP behaviour? |
1 task
Would setting a permalink structure in WordPress settings help here at all? |
Aha, I think I understand it better now. A rewrite rule from sitemap.xml to index.php (why index? not sure, need to inspect those plugins) may be needed to solve this. |
I was able to get it to work by using if (this.seemsLikeAPHPRequestHandlerPath(fsPath) || php.fileExists(fsPath)) {
return(php.request(request));
}else{
// we need to do a run here
const scriptPath = `${this.requestHandler.documentRoot}/index.php`;
console.log(scriptPath);
return(php.run({
relativeUri: requestedUrl.pathname,
protocol: (requestedUrl.protocol || '').replace(':', ''),
method: request.method || 'GET',
$_SERVER: {
REMOTE_ADDR: '127.0.0.1',
DOCUMENT_ROOT: this.requestHandler.documentRoot,
HTTPS: request.url.startsWith('https://')
? 'on'
: '',
},
body: request.body,
scriptPath,
headers: request.headers,
}));
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The request is handled as though it is for a static file in packages/php-wasm/universal/src/lib
/php-request-handler.ts.
The leading sitemap plugins generate sitemap.xml on request, so give a 404 error on playground.
The text was updated successfully, but these errors were encountered: