Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

How do I make it so all traffic is directed for the entire site and all subdirectories from non-www to www Here is my .htaccess contents:

RewriteEngine on

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/vivalast
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>

RewriteCond %{HTTP_HOST} ^domain-name.com$
RewriteRule ^(.*)$ "http\:\/\/www\.domain-name\.com\/$1" [R=301,L]
share|improve this question

marked as duplicate by Zistoloen, bybe Oct 13 '13 at 20:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Please ensure you read rules before continuing to post unnecessary duplicates. –  bybe Oct 13 '13 at 20:15
add comment

1 Answer 1

Try this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^a.com[nc]
RewriteRule ^(.*)$ http://www.a.com/$1 [r=301,nc]
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.