Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using CakePHP which already contains an .htaccess file that looks like:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]

I want to force www. (unless it is a subdomain) to avoid duplicate content penalties.

It needs to retain http or https


This application will have multiple domains pointing to it. So the code needs to be able to work with any domain.

share|improve this question

migrated from serverfault.com Feb 9 '11 at 22:40

This question came from our site for system and network administrators.

up vote 2 down vote accepted

Not to be evasive about your actual question, but Google was pretty clear that incidental duplication from things like this doesn't cause any penalties with their ranking algorithm:


I imagine that most search engines are not dumb enough to penalize the huge majority of sites on the Internet that respond to HTTP hosts with and without the leading "www."

share|improve this answer
Well, thats good news. That eliminates my need for this then. Thanks. – JD Isaacks Feb 10 '11 at 0:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.