Posted By

elvman on 09/08/11


Tagged


Versions (?)

Apache redirect to www


 / Published in: Apache
 

This snippet checks if modrewrite is enabled and redirects example.com/someuri to www.example.com/some_uri

  1. <IfModule mod_rewrite.c>
  2. RewriteEngine on
  3. RewriteCond %{HTTP_HOST} ^example\.com
  4. RewriteRule ^(.*)$ http://www.example.com$1 [R=permanent,L]
  5. </IfModule>

Report this snippet  

You need to login to post a comment.