Dec 162008
 

Sometimes when we typing www.website.com then the URLs automaticly turn into website.com (without www). Its a good idea for some people who wants to avoid redundant indexed address between www.website.com and website.com in search engine like Google or others.

To do this is so simple with .htaccess file if your host server can suppot it, but i think many host server is already accept .htaccess files inside your web.

Now, you can type this on the .htaccess files:

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

[NC] : Non case sensitive

R=301 : redirect (remove?) permanently from older URL address

Now, you can tried to type your web address with www in the begining of URL . What you see? is the ‘www’ disappear from the URL? If rights then you are succesfully removing www from URL with .htaccess files.

  2 Responses to “Remove www from URL address with .htaccess”

  1. thanks for the tips

  2. great forums dude :D

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create