Community & Support

Totally adding or removing 'www.' prefix

Hello,

I've got a site I've picked up, and I'm doing some SEO on it. I'm a little confused, though, becuase the site contradicts it's self with the 'www.' prefix. The htaccess is set up to force 'www.', but the relative paths in the site all link without it. This pisses off the search engines, which see www.mysite.com and mysite.com as two different sites that shouldn't be listing each other in their sitemaps and rss feeds.

Where are the different config options for setting this up?

Also, I suppose I'm not rewriting the .htaccess correctly. I've uncommented this:
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

but haven't modified it. For instance, should '^example\.com$' become '^mysite\.com$'?

Comments

I think I answered my own

I think I answered my own question. I needed to modify what I uncommented in .htaccess, exactly as I asked in my post. Thanks!

"Don't nothin' come to a sleeper but a dream,
A vision without a plan is just a hallucination"
- E-40

Base URL

I don't see which version you are using, but in 7.0 there is a setting for Base URL in the settings.php around line 230. I use that. $base_url = 'http://www.example.com';