I’d love to use Gitlab Pages to host my page on e.g. a custom domain, but without that subpath /project-name/ - reading the docs seemed like it’s not possible and googling didn’t really tell me anything
Is it possible? If not, is there a Gitlab issue about it?
You could search the Gitlab issues and see if someone has opened an issue for it, and if nothing found you can open an issue for it. I expect though, considering that user/group pages are pinned to a DNS A record under the domain, that there shouldn’t be a reason for it not to work with project pages once Gitlab has been prepared to work that way.
Verified working on the CLI. dig is a command line tool to query DNS records.
$ dig _gitlab-pages-verification-code.o11y.love txt
;; ANSWER SECTION:
_gitlab-pages-verification-code.o11y.love. 1799 IN TXT "gitlab-pages-verification-code=<token_from_gitlab_pages_settings>"
$ dig o11y.love A
;; ANSWER SECTION:
o11y.love. 817 IN A 35.185.44.232
Note that I prefer to use the A record with an IP address. Alternative methods suggested in the docs specify to create a CNAME/ALIAS record. Keeping the A record is easier imho, but needs the following knowledge: If the GitLab Pages IP address changes in the future, this will be announced and one can plan accordingly to update DNS records.
Can you share your custom domain name and settings you’ve done thus far?
This explains the DNS part, but it doesn’t seem to address the path portion.
There different types of Gitlab pages: user pages, group pages, and project pages.
If you want the website to be hosted at https://yourdomain.com/ instead of yourdomain.com then you will have to user user pages or group pages.
Here is a documentation page that explains things in more detail:
As far as I know there is an open issue about it, best post there.
I just solved it by generating the static html with the base url set to the project path as i’m building in the same pipeline