leungeric.com

Digg del.icio.us Technorati StumbleUpon Twitter

Force www. in your URL using .htaccess

.htaccess | Tutorials & Resources

1 Star2 Stars3 Stars4 Stars5 Stars (3.4 out of 5)
Loading ... Loading ...

Just add the following code to your .htaccess file in the highest folder of your web directory and yor visitors will be forced to use the www version.

RewriteEngine on

RewriteCond %{HTTP_HOST} !^www.your_domain.com$

RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]

  • Digg
  • del.icio.us
  • Technorati
  • StumbleUpon
  • Reddit
  • TwitThis
  • Sphinn
  • BlinkList
  • Furl
  • Mixx
  • NewsVine
  • Slashdot
  • Ma.gnolia
  • Facebook
  • Google
  • E-mail this story to a friend!

One Comment, Comment or Ping

  1. cwxwwwxdfvwwxwx

    well, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch ;)

Reply to “Force www. in your URL using .htaccess”

Sponsors