Redirect www Domain Not Working


#1

I wan my abc.com redirect to www.abc.com, using DO droplets, domain register on nameSilo.
have rebuild app, when visit abc.com that was no auto redirect, its that still any setting? Add A record?

I was follow the guide:

yml I added:

after_web_config:
    - replace:
        filename: /etc/nginx/nginx.conf
        from: /sendfile.+on;/
        to: |
          server_names_hash_bucket_size 64;
          sendfile on;
    - file:
        path: /etc/nginx/conf.d/discourse_redirect_1.conf
        contents: |
          server {
            listen 80;
            server_name abc.com;
            return 301 $scheme://www.abc.com$request_uri;
          }

(Michael - DiscourseHosting.com) #2

Feel free to use our service forcewww.com for that!


(Michael Brown) #3

What happens when you go to abc.com? Since you’re asking about adding an A record this makes me think that you don’t have any A/AAAA records for abc.com which means your browser would have no idea where to go.


#4

Now access abc.com or www.abc.com is no problem.

Just the cookies seems not shared, when login on abc.com, the www.abc.com no login automatic.

So now I wanna when user visit abc.com, redirect to www.abc.com

My discourse install on root domain.