• Blogging
  • Technology News
  • How To
  • Webmaster Tips

The Web Files

Web site promotion and marketing info, Helpful Tips, Latest Gadgets, News and Webdesign Services

  • Home
  • Blog
  • Archives
  • Links
  • About
  • Contact

You are here: Home / How To / Htaccess to add www to all pages of a site

Htaccess to add www to all pages of a site

June 8, 2007 by Tricia

I’ve been trying to work on my htaccess file for one of my other domains feverishthoughts.com for a few weeks. What I’d like is for the main website on feverishthoughts to have www in the url but ever new htaccess code that I’ve tried seems to fail and worse often ends up messing up how my site works.

I’m so frustrated I could start throwing folding chairs, and other things around!

I mentioned my problem in a forum and wrote a post about it on my main blog and some people have been very nice and offered up codes to try but nothing is working.

If anyone reading this post has an htaccess code for me to try that will put www in all the urls for my main blog even if they came to the site using a link without the www I’d appreciate it.

I wonder if part of the problem is that this domain thewebfiles.com is the main domain on my server?




Filed Under: How To, SEO, Site maintenance, Webmaster Tips Tagged With: blog, code, code to add www, frustrated, htaccess, optomising site with www, pr, url, urls, website

Comments

  1. Imagex says

    June 8, 2007 at 9:53 pm

    You might also want to set up redirects from the www. to the non www or vice versa so that you get a compounding effect from incoming links, because search engines treat the 2 url versions differently, but the redirect combines the link love.

  2. Jan London says

    September 11, 2007 at 8:08 am

    How about this one?

    Options FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

    The first line isn’t necessary. This code works for all of my domains perfectly.

  3. philip says

    July 14, 2008 at 2:29 pm

    @jan –
    Thanks for that, but there is a typo in there:

    the last line should have a dollar sign before the numeral 1 e.g.

    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

    Thanks, tho

Connect with Us

  • Facebook
  • Flickr
  • Instagram
  • Pinterest
  • RSS
  • Twitter

Categories


Eavestrough Cleaning Toronto

Recent Posts

  • Top Social Media Automation Tools Designed For Marketers
  • Social Selling: The Right Way to Sell Through Social Media
  • When in Doubt Turn to SEO Consulting
  • Considering using Guest Bloggers
  • Can you make money blogging? Yep
  • The World Of Blogging
  • Internet Marketing And Permission-Based Email Marketing

Recent Comments

  • Locked out my own sites by Bad Behavior plugin — The Web Files on The War on Comment Spam
  • AspDotNetStorefront E-commerce shopping cart — The Web Files on What Are The Best Ways To Make Money Using A Blog?
  • I changed my do follow plugin to Lucia’s Linky Love — Tricia's Musings on I’m not against website urls – I’m against comment spam
  • diagnosing comon windows errors on It’s important to backup your data regularly
  • Parol on Social Selling: The Right Way to Sell Through Social Media

Shopping

Gifts, Gadgets, computers and More! At our Amazon store.


Site Stats





Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

Blogroll

  • Eavestrough Cleaning Toronto
  • The Career Strategist

Other Sites

  • Gifts, Gadgets, Books and More!
  • Shopping Maniac
  • Organic Gardening Tips
  • Amphibian Care
  • Truly Odd Planet

Search our Site

Pages

  • About
  • Archives
  • Become a Guest Blogger at The WebFiles
  • Blog
  • Canadian Bloggers
  • Contact
  • Disclosure
  • Do Follow Bloggers
  • Links
  • Privacy Policy
  • Toronto Bloggers

Tags

Affiliate article articles blog Blogger Blogging Blogroll blogs business comment comments computer CPU design easy email features Google How To install instructions Internet internet marketing Keyword page rank plugin plugins posts problem resources search engine SEO sites Software tech traffic Video visitors Web web host website Wordpress Wordpress Plugin write writing

Copyright © 2025 · News Pro Theme on Genesis Framework · WordPress · Log in