Redirect a www prefixed site to a non-www prefix
Posted on July 10, 2007
I like clean URLs.
Add this to your .htaccess in the site root
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^DOMAIN\.com
RewriteRule (.*) http://DOMAIN.com/$1 [R=301,L]
Related posts
- .htaccess redirect based on requested domain
Imagine you have a selection of domain names that point to the same site, are... - Redirecting non-www to a www prefix
This old chestnut again. Create or edit the .htaccess file... - Apache redirects based on IP Address/Subnet
Ever needed to redirect a source IP address or source subnet in apache? Why? Redirect... - [Snippet] Redirecting Non-SSL Traffic to SSL
... - Redirecting WordPress index.php to root
If you check the Page Rank of http://bloke.org against http://bloke.org/index.php, which are both, to a...



