Redirect single/multiple domain(s) to your Discourse instance


(Jk Baseer) #71

Update DNS Record

Update the A record for the domain(s) you want to redirect to original domain.

It helped and so am sharing. If somebody trying to change the A Record for the route domain. Don’t use * in the hostname but @ in the hostname of Digitalocean DNS management.


(Stephen) #72

Why are you using digital ocean for DNS? It would be out recommendation to stick with your registrar’s DNS unless you’re looking to use specific features which require moving, such as Cloudflare or Route 53.


(Jk Baseer) #73

Not sure what’s the disadvantage of that. But the reason why i do it is using the registrar only for buying domain and leave that alone. Then manage everything in DO. Also their interface looks easy to manage multiple domains and setup.


(Keven Naphtali) #74

Here’s my issue:

If I redirect my naked domain example.com -> www.example.com using the instructions here, I have problems with my ssl certificate not being valid when going to example.com.

If I use NakedSSL to redirect example.com -> www.example.com. My cookies and therefore topics read seems to not display accurately.

What is the solution? I am using a docker install on digital ocean.

@techAPJ @codinghorror


(Jeff Atwood) #75

You must redirect to the “correct” form that you have certs for. Content cannot be at multiple domains simultaneously, that is a configuration error, and Google will ding you for duplicate content.


(Keven Naphtali) #76

Ok. I did get it working using the instructions as above. As you said my certificate probably hadn’t completely switched from the naked domain to the www domain.

However, I still have issues with discourse not remembering what I have read when I return to the root of the site. If I go straight to the root, all messages are shown as unread until I follow the latest and top links. Any idea what may be causing this behaviour?


(Michael) #77

Can someone please confirm these settings for me?

    - file:
        path: /etc/nginx/conf.d/www_redirect_1.conf
        contents: |
          server {
            listen 80;
            listen 443 ssl;
            server_name www.reddcointalk.org;
            return 301 https://reddcointalk.org$request_uri;
          }

The goal here is to redirect https://www.reddcointalk.org AND http://www.reddcointalk.org to https://reddcointalk.org. However, https://www.reddcointalk.org provides an SSL error. I’ve tried several different configurations of this but end up in the same place.


(Leo) #78

I suppose it works fine for you now; as the links mentioned are redirecting fine. I suppose you had to specify ssl_certificate and ssl_certificate_key. Can you please share your updated settings?