Report this

What is the reason for this report?

Unable to get www to redirect to non-www

Posted on May 6, 2013

Hi.

My site is currently working fine at the url ‘mysite.com’. I’d obviously like ''www.mysite.com to get re-directed to ‘mysite.com’ though.

I’ve tried the various suggestions in these threads and the documentation, and unfortunately none seem to work for me - I just get an error from my internet provider when I try to view the www version, and a time-out when I try to ping it. I would be extremely grateful if you could let me me exactly what I have to do to get this working.

This is my current set up:

A Record:
Hostname: @
IP Adress: my.ip.address CNAME:
Hostname(mysite): www
Hostname: @ (also tried mysite.com)

and in my htaccess:

<IfModule mod_rewrite.c> RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] </IfModule>

Many thanks.

The developer cloud

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

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.