Got massive duplicate content issues

Using a single web hosting account to host multiple sites

Got massive duplicate content issues

Postby nationalcycles » Tue Jul 24, 2007 2:30 am

:( I use oscommerce to as a shopping cart base and have used an seo product to change my links. The problem i have is that all my pages have been indexed in supplimental in both php and html extensions. It changes the url completely.
I have searched everywhere including this forum on how i can fix this and what i am looking for is the following.

In .htaccess a way to send a 404 to all .php extensions.
or
In .htaccess a way to send a 404 to all non html extensions

If someone can direct me to the right place and also confirm if this will affect my index page - http://www.nationalcycles.co.uk.

Please - I need help.
nationalcycles
 
Posts: 4
Joined: Tue Jul 24, 2007 2:22 am

Postby richardk » Tue Jul 24, 2007 2:33 pm

For a 404, try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^.+\.php$ /a_path_that_doesnt_exist [L]


Or for a 410 (Gone) status replace
Code: Select all
RewriteRule ^.+\.php$ /a_path_that_doesn't_exist [L]

with
Code: Select all
RewriteRule ^.+\.php$ - [G,L]


Or you could redirect to the .html URL by replacing
Code: Select all
RewriteRule ^.+\.php$ /a_path_that_doesn't_exist [L]

with
Code: Select all
RewriteRule ^(.+\.)php$ /$1html [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby nationalcycles » Wed Jul 25, 2007 12:25 am

Wow, that was quick and thanks for the advice.
I tried what you suggested but it conflicts with my php images but not sure how and other links.
To avoid this I think there might be another way to resolve my issue. As the duplicate links (3000+) are all in two formats;

www.nationalcycles.co.uk/product_info.p ... s_id=30037
and
www.nationalcycles.co.uk/index.php?cNam ... kes-4-bmxs

So my idea is can we send a 410 to all urls that include "products_id=" and "cName=" within the url.

I'm not sure if this is possible but i'll be happy if you could let me know.

P.S - I value your time and would like to donate to the continuation of this website, is this possible?
nationalcycles
 
Posts: 4
Joined: Tue Jul 24, 2007 2:22 am

Postby richardk » Wed Jul 25, 2007 10:11 am

So my idea is can we send a 410 to all urls that include "products_id=" and "cName=" within the url.

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{QUERY_STRING} ^(.*&)?(products_id|cname)= [NC]
RewriteRule ^.+\.php$ - [G,L]


If it doesn't work, post your current mod_rewrite.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby nationalcycles » Wed Jul 25, 2007 11:27 am

Excellent, it works!
I've added some others to the code:
RewriteCond %{QUERY_STRING} ^(.*&)?(products_id|cname|pName|cPath)= [NC]
RewriteRule ^.+\.php$ - [G,L]
However, i tried to add "-c-" without success. - Your a genius!
nationalcycles
 
Posts: 4
Joined: Tue Jul 24, 2007 2:22 am

Postby richardk » Wed Jul 25, 2007 12:10 pm

However, i tried to add "-c-" without success.

Where did you try to add it? Could you give an example of a URL with "-c-" in it?

Also try
Code: Select all
^(.*&)?([^=]*-c-[^=]*|products_id|cname|pName|cPath)=
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby nationalcycles » Wed Jul 25, 2007 12:20 pm

Examples to add (-p- | -c-)
www.nationalcycles.co.uk/-c-1498_1501.html
www.nationalcycles.co.uk/diamondback-lucky-p-30414.html

I tried to add it to:
RewriteCond %{QUERY_STRING} ^(.*&)?(products_id|cname|pName|cPath|-c-|-p-)= [NC]

Cheers
William
nationalcycles
 
Posts: 4
Joined: Tue Jul 24, 2007 2:22 am

Postby richardk » Wed Jul 25, 2007 1:08 pm

It's not part of the query string.

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^.*-(p|c)-.*\.html$ - [G,L]

RewriteCond %{QUERY_STRING} ^(.*&)?(products_id|cname|pName|cPath)= [NC]
RewriteRule ^.+\.php$ - [G,L]


You could also use a robots.txt file.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 8 guests

cron