Lowercase Pages URLs of mixed case Project slug, causing redirect loops when 'Use unique domain' is disabled

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

When creating private project "Project slug" has Capital case url and “Use unique domain” is disabled in GitLab Pages settings, and the lowercase Pages URLs causing redirect loops.

Note:

The related MR is older and this Issue was created after it. It is a different issue and this still exists. This issue is a corner case when users explicitly lowercase their Pages URL to access it.

Steps to reproduce

  1. Create a new private project with mixed case Project slug (e.g., “MyTestProject”)
  2. Set up GitLab Pages
  3. Configure Pages settings:
  • Go to Settings → Pages
  • Ensure "Use unique domain" is disabled
  • Save changes
  1. Copy the link under the Deployments and make it lowercase and try to access it.

Example Project

Project slug: MyTestProject

What is the current bug behavior?

With "Use unique domain" disabled: the lowercase Pages URLs causing redirect loops.

What is the expected correct behavior?

With "Use unique domain" disabled: the lowercase Pages URLs should serve expected content after authentication.

Relevant logs and/or screenshots

Screenshot 2025-03-21 at 5.48.20 PM.png

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
   (For installations with omnibus-gitlab package run and paste the output of: \\\\\\\`sudo gitlab-rake gitlab:env:info\\\\\\\`)  (For installations from source run and paste the output of: \\\\\\\`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\\\\\\\`)    

Results of GitLab application Check

Expand for output related to the GitLab application check
  (For installations with omnibus-gitlab package run and paste the output of: \\\`sudo gitlab-rake gitlab:check SANITIZE=true\\\`)  (For installations from source run and paste the output of: \\\`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true\\\`)  (we will only investigate if the tests are passing)   

Implementation guide

Investigate where in pages code base this issue is arising and then find a solution. Pages code base can be easily debugged.

Edited by 🤖 GitLab Bot 🤖