Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Jan 11, 2011 10:17 pm 
Offline
Newbie

Joined: Tue Jan 11, 2011 10:10 pm
Posts: 2
Everything seems to be working fine when I visit my site with just http://yogacarashop.com , however when I try http://www.yogacarashop.com , I'm led to a Forbidden page.

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.


Top
   
 Post subject:
PostPosted: Tue Jan 11, 2011 11:31 pm 
Offline
Senior Member

Joined: Mon Dec 20, 2010 11:37 pm
Posts: 76
You have to add ServerAlias inside apache configuration:
Code:
    ServerAdmin webmaster@yogacarashop.com
    ServerName yogacarashop.com
    ServerAlias www.yogacarashop.com


EDIT: if it doesn't work, try this .htaccess:
Code:
<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>


Top
   
 Post subject:
PostPosted: Wed Jan 12, 2011 1:41 am 
Offline
Newbie

Joined: Tue Jan 11, 2011 10:10 pm
Posts: 2
Haha thanks! That did the trick.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group