[thelist] removing the www. from my urls

liorean liorean at f2o.org
Fri Mar 19 04:46:28 CST 2004

Dunstan Orchard wrote:
> Hi there,
> Does anyone know of any .htaccess code I can use to remove the www. from 
> my urls?
> I did try this:
> # remove the www from url
> RewriteCond %{HTTP_HOST} ^www\.1976design\.com$ [NC]
> RewriteRule ^(.*)$ http://1976design.com/$1 [R=301,L]
> from the guys at:
> http://no-www.org/
> And while it worked for my homepage, it failed to rewrite anything 
> beyond that. So if someone came directly to:
> http://www.1976design.com/blog/
> Nothing changed.
> Any ideas?

Try this:

Options +FollowSymlinks

# mod_rewrite
RewriteEngine on
RewriteOptions inherit
RewriteBase physical-address-of-your-web-root
RewriteCond %{HTTP_HOST} ^www\.1976design\.com$ [NC]
RewriteRule ^(.*)$ http://1967design.com/$1 [R=301,L]

David "liorean" Andersson

ViewStyles, ViewScripts, SwitchStyles and GraphicsInfo bookmarklets:
<http://codingforums.com/> <http://yourmusicforums.com/>

More information about the thelist mailing list