Gitlab pages redirects do not work

The pages site is here

All I want is for

To redirect to

Here are the redirects I have tried.

/DocSite/ /DocSite/Perdmi1888.html 301
/DocSite/ /DocSite/Perdmi1888.html 302
/DocSite/index.html /DocSite/Perdmi1888.html 301
/DocSite/index.html /DocSite/Perdmi1888.html 302
/DocSite/index /DocSite/Perdmi1888 301
/DocSite/index /DocSite/Perdmi1888 302
/docsite/ /docsite/Perdmi1888.html 301
/docsite/ /docsite/Perdmi1888.html 302
/docsite/index.html /docsite/Perdmi1888.html 301
/docsite/index.html /docsite/Perdmi1888.html 302
/docsite/index /docsite/Perdmi1888 301
/docsite/index /docsite/Perdmi1888 302 301 302

What is the correct way to do this?

I can only assume that redirects simply do not work.

I came across this forum as I was running into similar issues with redirects in GitLab Pages.
First, make sure the redirects are in a file called “_redirects” in the public directory. At first, I made a typo when naming the file, so obviously none of the redirects would work!

The other reason seems to be that the “from” location as part of the redirect can’t already exist. In other words, files take precedent over redirects. For example, if one of the redirects is:

/index.html /index2.html 302

If index.html is an existing file, then the redirect won’t work.

In my case, I was trying to redirect my base domain to the www subdomain. My workaround was creating a separate repo for my base domain, and having a “_redirects” file without an “index.html”. That way, there is no existing files that will “block” the redirect from happening.