Can't access my website with www
I'm running Ubuntu 10.04, and currently I've tried redirecting the www to non-www with .htaccess, but that didn't work out. I also tried modifying the apache2.conf in /etc/apache2/apache2.conf to redirect the www to non-www, but that apparently puts it in a redirection loop. I'm not really sure what to do from here.
2 Replies
ServerAdmin webmaster@yogacarashop.com
ServerName yogacarashop.com
ServerAlias www.yogacarashop.com
EDIT: if it doesn't work, try this .htaccess:
<ifmodule mod_rewrite.c="">RewriteEngine on
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]</ifmodule>