mod_rewrite for geeks

some people have noticed that when they type in www.attrition.org into their browser, it ends up stripping out the www and leaving it just http://attrition.org. this is really simple to do and this page exists not just to show you how, but explain why.

first, you need mod_rewrite functionality enabled on your web server. you can find out more about this on our anti-theft mod_rewrite page.

second, you need a new rule in your .htaccess file that actually removes the ugly www. Of course you need to replace attrition.org with YOUR domain, but you probably guessed that.


RewriteEngine on

# http://no-www.org/
RewriteCond %{HTTP_HOST} ^www\.attrition\.org$ [NC]
RewriteRule ^(.*)$ http://attrition.org/$1 [R=301,L]

third, don't ask me questions beyond this, I don't know much more about rewrite.

now, for those digital ninjas amongst us, you probably noticed the commented line in the text above. that's right, click on over to http://no-www.org and see why this is a good thing to do.


main page ATTRITION feedback