By tijmenhelder
Hello,
When I log in to my site WITHOUT www. it works fine, but whenever I visit the site with www. the same username and password don’t seem to work. I added www as a A record in the DNS, without it I could even only visit the website without www.
It’s hosted on Ubuntu 14.04 and the application is written in Ruby on Rails.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Right, to access www.your-domain.tld you need to set up either an A record or CNAME pointing to it. Your password issue is perplexing though. I’m having a hard time imagining what would cause that! I’d suggest redirecting the www subdomain back to the main one, as it’s usually a good idea to pick one or the other either way. <br> <br>Since you’re using Rails, I imagine you’re also using Nginx? Edit your configuration to add a new server block that sets up a redirect from www to the root domain. It would look something like: <br> <br><pre> <br>server { <br> listen 80; <br> server_name www.your-domain.tld; <br> return 301 http://your-domain.tld$request_uri; <br>} <br> <br>server { <br> listen 80; <br> server_name your-domain.tld; <br> # And whatever else… <br>} <br></pre>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.