Apache redirect from domain.com to www.domain.com


/ Published in: Regular Expression
Save to your folder(s)



Copy this code and paste it in your HTML
  1. RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
  2. RewriteCond %{HTTP_HOST} !^$
  3. RewriteRule ^/(.*) http://www.domain.com/$1 [L,R]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.