Report this

What is the reason for this report?

How to make www work and redirect to non www

Posted on March 5, 2014

I was curious the best way to forward www.mysite.tips to the non www version. It seems right now www does not work at all on my site. Thanks



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!

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.

Interesting that you posted this as I am having the same exact problem. I can’t access my site via www. prefix, but without it I can.

What you do is add your domain without the “www” and then create an A record with www as the hostname and then your IP address. <br> <br>If you want to redirect www to without www use this code: <br> <br>RewriteEngine On <br>RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] <br>RewriteRule ^(.)$ http://example.com/$1 [R=301,L] <br> <br>Or vice versa: <br> <br>RewriteEngine On <br>RewriteCond %{HTTP_HOST} ^example.com$ <br>RewriteRule (.) http://www.example.com$1 [R=301] <br> <br>Here’s a screenshot of the DNS records: http://cl.ly/UGcn

did you solve your issue? <br> <br>you didn’t mention yet what web server you are using because each one has different way of redirecting… <br> <br>seems like you use Aapache!!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.