Fixed my htaccess to drop the www prefix

27 May 2006

A while ago I decided to drop the www prefix from my domain, this went swimmingly for the root davidsmalley.com/ directory, but for some reason the .htaccess in my /blog/ directory was doing some funky stuff to the URI it rewrote to, occasionally appending the internal directory structure of my hosting server rather than the request URI.

Well, after posing this question to a mailing list I’m on someone came up with the solution. davidsmalley.com now rewrites seamlessly.

Here’s the rewrite rule I use:

RewriteCond %{HTTP_HOST} ^www\.davidsmalley\.com$ [NC] RewriteRule ^.*$ http://davidsmalley.com%{REQUEST_URI} [R=301,L]

Comments

Sorry, comments are closed for this article.