Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab Pages custom domain allow www

What do I need to do in order for my GitLab pages site (Jekyll) to be accessed under www.mydomain.com not just mydomain.com? I have SSL through CloudFlare.

In my DNS I have: mydomain.com A 104.208.235.32

and CNAME points to myname.gitlab.io, and www points to myname.gitlab.io

Do I need to create a subdomain of www and point those to GitLab as well? I'd like my site to be without www in the url, but if a user types in www they should still be able to access the site.

like image 921
evan Avatar asked Sep 05 '16 15:09

evan


People also ask

What is the URL for GitLab pages?

Your project's URL is https://gitlab.com/websites/websites.gitlab.io . Once you enable GitLab Pages for your project, your website is published under https://websites.gitlab.io . General example: On GitLab.com, a project site is always available under https://namespace.gitlab.io/project-name.

Are GitLab pages free?

With GitLab Pages you can host your static website for free.

Does GitLab pages support PHP?

To publish a website with Pages, you can use any static site generator, like Gatsby, Jekyll, Hugo, Middleman, Harp, Hexo, or Brunch. You can also publish any website written directly in plain HTML, CSS, and JavaScript. Pages does not support dynamic server-side processing, for instance, as . php and .


1 Answers

The configurations in the question are correct, what I didn't do is add both mydomain.com and www.mydomain.com as domains in GitLab (Settings icon > Pages > New Domain).

GitLab then directs traffic to both www and the naked domain when both domains are listed.

like image 102
evan Avatar answered Oct 18 '22 10:10

evan