Remove WWW from domain with .htaccess

VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)

Another good thing about removing double content is to remove or add www prefix to your domain.

Remove WWW from domain

# This will remove www from your domain
RewriteCond %{HTTP_HOST} ^www.mediabox.lv$ [NC]
RewriteRule ^(.*)$ http://mediabox.lv/$1 [R=301,L]

This is what I now use for all my domains – domain without www prefix.

Add WWW to domain

This probably is best for old domains like mine www.rolandinsh.lv

# This will remove www from your domain
RewriteCond %{HTTP_HOST} ^mediabox.lv$ [NC]
RewriteRule ^(.*)$ http://www.mediabox.lv/$1 [R=301,L]
VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Another good thing about removing double content is to remove or add www prefix to your domain. Remove WWW from domain This is what I now use for all my domains – domain without www prefix. Add WWW to domain …

1 Comment

  1. April 20, 2010 Removing WWW from URI (or domain) with PHP | Full time WEB Freelancer | WordPress, BuddyPress, WordPress MU and Web developer

Leave a Reply

Your email is never published nor shared.

*

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