Question

Add www to domain

  • Posted May 6, 2014

I have Ghost 0.4.2 set up on http://www.thepapermail.com. However, when you enter http://thepapermail.com, you are still presented with the same general page. None of my links work with that, though, because I have Ghost configured to use www before the URL.

I tried adding a cname with www pointing to @, but that didn’t work. Then I added an A record with www pointing to my server’s IP address. That didn’t work either.

Does anyone know of a way to force prepend www to the domain?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Glad it worked! <br> <br>No, you should keep DNS records pointing both www.thepapermail.com and thepapermail.com to that IP address.

Worked perfect, Andrew. One more thing: should I remove any of the records I added in DNS settings?

You can force a redirect to www by editing the nginx configuration like so: <br> <br><pre> <br>server { <br> listen 80; <br> server_name thepapermail.com; <br> return 301 http://www.thepapermail.com$request_uri; <br>} <br>server { <br> listen 80; <br> server_name www.thepapermail.com ; <br> <br> client_max_body_size 10M; <br> <br> location / { <br> proxy_pass http://localhost:2368/; <br> proxy_set_header Host $host; <br> proxy_buffering off; <br> } <br>} <br></pre> <br> <br>This is found in: <br> <br><pre> <br>/etc/nginx/conf.d/default.conf <br></pre> <br> <br>Let us know how it goes!