Forum Moderators: phranque

Message Too Old, No Replies

htaccess help to fix duplicate content issue?

         

BigFreckle

4:15 pm on Apr 9, 2007 (gmt 0)

10+ Year Member


My homepage is indexed twice:

1) www.domain.com/

AND

2) www.domain.com/?N=D

I would prefer just the first option only. I've tried tinkering with many code snippets from other posts that looked somewhat similar but no luck.

Any help or advice on how I could correct this situation would be greatly appreciated.

Currently my .htaccess looks like this:

DirectoryIndex index.html

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}!^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example/$1 [L,R=301]
</IfModule>

[1][[b]edited by[/b]: BigFreckle at 4:18 pm (utc) on April 9, 2007][/1]

bobothecat

4:20 pm on Apr 9, 2007 (gmt 0)



You could try this:

RewriteCond %{query_string} .
RewriteRule (.*) http://www.example.com/$1? [R=301,L]

BigFreckle

4:35 pm on Apr 9, 2007 (gmt 0)

10+ Year Member



Thanks, bobothecat.
It works.

That was really getting me frustrated.
Really appeciated the quick reply.