kieranbarnes Independent PHP, WordPress & CubeCart Programmer

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

  1. .htaccess redirect based on requested domain
    Imagine you have a selection of domain names that point to the same site, are...
  2. Redirecting non-www to a www prefix
    This old chestnut again. Create or edit the .htaccess file...
  3. Apache redirects based on IP Address/Subnet
    Ever needed to redirect a source IP address or source subnet in apache? Why? Redirect...
  4. [Snippet] Redirecting Non-SSL Traffic to SSL
    ...
  5. 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...

Posted by Kieran


Tagged as: Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.