Error 401 when using custom domain with www


I am getting error “401 - you don’t have permission to access the resources” when using ‘www’ in the URL. Though the URL works fine when used without www.

Please see the below links (this link giving 401 error) (this link works fine)

What can I do?

Thank You

Hello, did you solve it? Please help, I am struggling same thing.

I have tried setting in my custom domain control panel these settings:

TXT _gitlab-pages-verification-code.www → gitlab-pages-verification-code=SOME_CODE

or do I need to add A record like:


I had a similar problem.

I did everything the docs showed:

But(!) I also had to:

  • Add as New Domain to Gitlab Pages
  • And verify it via a TXT record

Took me a while to figure this out. Hope it’s helpful to someone else as well.