DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

301 Example.com To Www.example.com

04.23.2005
| 5423 views |
  • submit to reddit
        
RewriteEngine On

RewriteCond %{HTTP_HOST} !^(.*)\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]