Redirecting non-www to a www prefix
Posted on May 22, 2010
This old chestnut again.
Create or edit the .htaccess file
- RewriteEngine On
- RewriteCond %{HTTP_HOST} !^www\.YOURDOMAIN\.COM$ [NC]
- RewriteRule ^(.*)$ http://www.YOURDOMAIN.COM/$1 [R=301,L]
Related posts
- Redirect a www prefixed site to a non-www prefix
I like clean URLs. Add this to your .htaccess in the site root RewriteEngine on... - [Snippet] Redirecting Non-SSL Traffic to SSL
... - Apache redirects based on IP Address/Subnet
Ever needed to redirect a source IP address or source subnet in apache? Why? Redirect... - .htaccess redirect based on requested domain
Imagine you have a selection of domain names that point to the same site, are... - mod_geoip Revisted including stopping spam in phpBB 2
I've recently moved a client's forum onto a new cPanel server, previously it was on...



