Skip to content
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

plugin-client-redirects does not respect baseurl #2980

Closed
smazanek opened this issue Jun 22, 2020 · 1 comment
Closed

plugin-client-redirects does not respect baseurl #2980

smazanek opened this issue Jun 22, 2020 · 1 comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers

Comments

@smazanek
Copy link

🐛 Bug Report

Tried all kind of combinations but did not get plugin-client-redirects to consider the baseurl set for the project. My expectation would be that the following works if baseurl is set (in my case to baseUrl: '/pages/teamabc/website/public/'), but build step fails complaining that the "to" path is not valid:
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
to: 'docs/ec2/overview',
from: ['/docs/ec2/'],
}
],
},
],
I further tried to specify redirect using full URL (but it is complaining that it only expects a path, not URL) and also tried for "to:" with "baseurl + docs/ec2/overview", this is building but it is then duplicating the baseurl when I try to access the link in the website, i.e. it is redirecting to /pages/teamabc/website/public/pages/teamabc/website/public/docs/ec2/overview

Your Environment

  • Docusaurus version used: Version: 2.0.0-alpha.58
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Chrome
  • Operating system and version (desktop or mobile): Desktop
@smazanek smazanek added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jun 22, 2020
@slorber
Copy link
Collaborator

slorber commented Jun 23, 2020

Hey, you are absolutely right. The plugin is new as of alpha 58 and unfortunately didn't test it with baseurl :/

There has been a fixed merged to master already for fromExtension / toExtension, but it does not apply to redirects or createRedirect.

Opened this issue to track the problem so I'm going to close this one: #2982

This should be fixed for next release

@slorber slorber closed this as completed Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants