2008/7/13 Mike Linksvayer <[EMAIL PROTECTED]>:
> On Sun, Jul 13, 2008 at 12:23 PM, Nathan Kinkade
> <[EMAIL PROTECTED]> wrote:
>> Here's what we use for creativecommons.org (requires mod_rewrite):
>>
>> RewriteCond %{HTTP_HOST} =www.creativecommons.org
>> RewriteRule ^/(.*)$ http://%{SERVER_NAME}/$1 [L,R=301]
>
> There's a website dedicated to just this, btw -- http://no-www.org :)
>
> Mike
>

Interesting.  Their approach was slightly different from the one I
implemented for (cc).org.  I guess it just goes to show that there's
more than one way to skin a cat (and also to strip the www from a
domain):

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

I should also note that the approach I listed above is meant to work
from the vhost configuration file, not from an .htaccess file.  To
make it work in an .htaccess file change the RewriteRule to:

RewriteRule ^(.*)$ http://%{SERVER_NAME}/$1 [L,R=301]

Nathan
_______________________________________________
cc-devel mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/cc-devel

Reply via email to