BANS Duplicate Content & No 404 Pages
June 27, 2008 By: Justin | 9 commentsSo I just switched a domain over to BANS and noticed that dead URL’s return a 200 status code instead of a 404. It is hardcoded into BANS to return the main index page content with a status code of 200 if a page is not found. Well, this is a problem in terms of SEO.
The 200 status code tells Google the page exist and can be indexed. (and it will index it) If there are links pointing to a page on your site that should be 404, it will get indexed as a duplicate of the main page.
Standard methods of dealing with 404’s don’t work. A .htaccess entry won’t do the trick. You could manually disallow these pages in robot.txt, but that could be a horrible task if you have many pages. The site I switched over had 100 indexed pages before the switch. I now have about 80 duplicate pages indexed by Google with nothing but item listings and no content. All with same title. This is a big duplicate content problem.
A Solution
I found a cool hack from sonjay on the BANS forum, but it didn’t 100% solve my problem. I didn’t really like the solution 100%, and I’m not 100% happy with my solution either. But I played around and I’m getting the effect I want.
Go Into Your Index.php
I inserted this at line 563, right after
// End –>
</script>’;
and right before
if ($front->q != ” && $front->mainCat != ‘
INSERT THIS
Wordpress messes up the code, so here it is in a txt file
Why the 301?
Well, I could have gone with the 404 and had the pages deindexed, but I had links pointing to some of those old pages. I wanted to keep the link juice, so I went with the 301 redirect to send all incoming traffic to the homepage.
I Make No Promises
I got that code off a forum. I make no promises and assume no responsibility for its use. I got it to work fine on my BANS, but I can’t be responsible for it messing up any of your sites. I just thought it was worth sharing.
Tagged With 301 redirect, BANS, Build A Niche Store, PHP
Related PostsReasons .info BANS May Fail
A fair number of people have had issues with .info domains recently and .info BANS sites in particular. I recently wrote an article about how .info domains are different. Check
Dateless Sniper BANS Template
Another Free BANS Template from SEO Zombie. This time with a little twist. Over at Court’s Internet Marketing blog, he has blogged about a concept called keyword sniping. For the
Deindexed BANS Sites
If you’re running BANS, than you should know by know that some BANS sites are being targeted by Google and removed from their index. This a pain for anyone who
.Info Domains Are Different
Not all TLD (Top Level Domain) are treated equal. Google treats .info domains differently than .com domains. This is especially true due to a recent GoDaddy domain sale. Google is
BANS Template Modification
One important part of having a successful BANS site is having a good template. You don’t need to spend hours developing a theme, but you can increase your sales by















Hi any one can help me,please check why my site was not indexed in google.
Well, it not really showing links in Yahoo. I would work on link building. Plus, the dashes (-) in the domain name make it look a little spammy.
I was have a problem with this on one of my sites. Thanks so much for the little hack.
np Scott
Thanks a lot but I got error like below:
–
Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/themes/layout-1-both/header.php:7) in /home/xxx/public_html/index.php on line 565
Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/themes/layout-1-both/header.php:7) in /home/xxx/public_html/index.php on line 566
—
What happend?
Seems like an error in your theme?
I input in the first line of header.php and problem solved.
Oh, wordpress deleted it. I input ob_start at the first line of header.php