GitLab Pages custom domain permits www

What do I need to do so that the site GitLab (Jekyll) is available www.mydomain.comnot only 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, but wwwpoints tomyname.gitlab.io

Do I need to create a subdomain wwwand point them to GitLab? I want my site to be without wwwin the url, but if the user enters www, he should still have access to the site.

+11
source share
3 answers

, , , mydomain.com, www.mydomain.com GitLab ( > > ).

GitLab www, , .

+13

www.example.com gitlab. www URL- -www.

<script type="text/javascript">
if ( document.domain.substring(0,4) != 'www.' ) {
    window.location = document.URL.replace("//","//www."); 
}
</script>

: https://www.experts-exchange.com/questions/26846703/redirect-non-www-to-www-url-using-Javascript.html

0

2019, www .
:

  1. www GitLab
  2. In your DNS provider (it works for all of them, not just CloudFlare, which is not clear from the GitLab documentation) add a CNAME record with a name wwwand value yoursite.com.
0
source

Source: https://habr.com/ru/post/1653699/


All Articles