Search code examples
gitlabgitlab-pages

Unexpected GitLab page URL


I had a Gitlab Pages hosted at https://username.gitlab.io/project/. I deleted and recreated the project (https://gitlab.com/username/project/) to start again with a clean history.

The page url is now https://project-username-longrandomhash.gitlab.io. https://username.gitlab.io/project/ redirects to https://monprojet-username-longrandomhash.gitlab.io.


Solution

  • Since GitLab 15.11, new projects will have the enable unique domains setting enabled by default. This is a security-related change that helps prevent cookies from being shared between your different Pages sites, helping secure them against attacks that would be prevented by using different domains.

    When you re-created your project, it will have been created with this setting enabled. Assuming your project was originally created before the release of GitLab 15.11, that would explain this change. If you wish to disable this feature, you can unselect the 'enable unique domains' feature in the project settings.