I am using GitLab SaaS (gitlab.com). I think I want to transfer a project in my personal account to a group. The documentation states quite cleary that GitLab user interface pages will redirect from the old location of the project to the new location, and that Git remote urls will be forwarded, too. However, it does not state anywhere whether the same is true of the website created using GitLab Pages.
Hi, I just tested this out and can confirm that Pages sites do not redirect if you transfer a Pages project between namespaces/groups. Here are the steps I took:
- Created a Pages project here: John Coghlan / testing1 · GitLab and run pipeline in project
- Confirmed the site was rendering at http://pages-testing.gitlab.io/pages-testing-1.
- Transferred project to my personal namespace: John Coghlan / testing1 · GitLab
- Confirmed the site was rendering at Plain HTML site using GitLab Pages.
- Checked for a redirect from http://pages-testing.gitlab.io/pages-testing-1 which threw a 404 instead of redirecting me to the new site.
I’ve asked the GitLab Pages team to review our documentation and see if we should add some clarity around this.
Thank you for the thorough research and reply!
It is disappointing for me. I would like to apply with the Wontache project to GitLab for Open Source, but this requires the project to be in a group namespace. Breaking the website of the project is a no-go for me.
If GitLab pages could be made to redirect, or if GitLab for Open Source could somehow be enabled for personal namespaces, that would be great.
A potential workaround is registering a custom domain which is the single source of truth (note: I did not test the following steps).
- Register a custom domain for your website, say
- Follow the documentation for configuring a custom domain with Lets Encrypt TLS support . Custom domains and SSL/TLS certificates | GitLab
- For anyone that accesses user-name.gitlab.io/project you’ll add a redirect via index.html to yourprojectdomain.com (e.g. Redirect from an HTML page - Stack Overflow)
- Once the project has been migrated, update the DNS records and do the GitLab Pages setup challenge and verification again (this will be necessary afaik, since the project ID and setup code may change). https://yourprojectdomain.com remains accessible by doing so.
Native pages redirects to a different (sub) domain will require domain-level redirects proposed in Support domain-level redirects (#601) · Issues · GitLab.org / gitlab-pages · GitLab