Have you read the Contributing Guidelines on issues?
Prerequisites
Description
Description
Accessing docusaurus build by direct URL domain.com/index.html causes a duplicated page issue.
It looks like shipped docusaurus serve CLI implements a redirect from index.html > /. And it is a specific logic which are not presented in http servers by default.
Background
I'm trying to migrate docusaurus 2.4.3>3.1.1 and faced an issues with merge-request integration in GitLab pipelines. GitLab pipeline produces a docusaurus build artifact which can be accessible by URL's like
some-domain.com/-/repoName/-/jobs/12345/artifacts/build/index.html.
Attempts to omit index.html part, i.e. some-domain.com/-/repoName/-/jobs/12345/artifacts/build/ caused of HTTP404 error. Probably it's possible to have a workaround fix by adjusting redirect rules for my case. Anyway, duplicated content behavior looks like a bug.
Reproducible demo
Steps to reproduce
- install from scratch
npx create-docusaurus@latest my-website classic --typescript
cd my-website/
npm install
npm run build
- run any http server to serve build over http (I'm using python http server to avoid side-effect redirects which shipped with
docusaurus serve)
cd build
python3 -m http.server 9005
- visit http://localhost:9005/index.html
Expected behavior
No duplicated content appears
Actual behavior
Whole site is rendered twice. Duplicated top-level menu and page content.



Your environment
Self-service
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clearoryarn clearcommand.rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages.Description
Description
Accessing docusaurus build by direct URL
domain.com/index.htmlcauses a duplicated page issue.It looks like shipped
docusaurus serveCLI implements a redirect fromindex.html>/. And it is a specific logic which are not presented in http servers by default.Background
I'm trying to migrate docusaurus
2.4.3>3.1.1and faced an issues with merge-request integration in GitLab pipelines. GitLab pipeline produces a docusaurus build artifact which can be accessible by URL's likesome-domain.com/-/repoName/-/jobs/12345/artifacts/build/index.html.Attempts to omit
index.htmlpart, i.e.some-domain.com/-/repoName/-/jobs/12345/artifacts/build/caused of HTTP404 error. Probably it's possible to have a workaround fix by adjusting redirect rules for my case. Anyway, duplicated content behavior looks like a bug.Reproducible demo
Steps to reproduce
npx create-docusaurus@latest my-website classic --typescript cd my-website/ npm install npm run builddocusaurus serve)cd build python3 -m http.server 9005Expected behavior
No duplicated content appears
Actual behavior
Whole site is rendered twice. Duplicated top-level menu and page content.
You can also observe this on https://docusaurus.io/index.html
Your environment
Self-service