When google tries to spider a link or cat already in its index which I have recently removed, it is re-directed to my home page. Having numerous "removed" links and cats all pointing with different names to my homepage has caused me to receive a duplicate content penalty on one of my sites. I am using mod-rewrite on 3.12.. The question is there a way to direct non-existing links and cats to a "404" or other error page?
and change index.php to where you want it to go. It can't be a real 404 because index.php itself does exist even if the specific category being requested doesn't.
Will add a 'content does not exist' template in the future.
No, what you're doing there is not correct. You need to simply change header("Location: index.php"); to header("Location: error.html"); Leave everything else alone. You could add the url= onto the meta refresh tag, but it will never get used on your server anyhow so there's no point.
After making the changes, mydomain.com/480 (480 is a no content cat) I get the error.html page. However, if I enter mydomain.com/nocontent I am re-directed to the main page.
Is there a fix to the using cat names re-directing? As said before, using cat numbers which do not exist will direct to the error page. If I use a invalid cat name it directs to index.php
i found this thread and i guess i am having the same problem. Most of my google referral are from details pages instead of the main categories page. So is it better to change this :- $thiscategory = new category('id', $catid); // create proper category object if ($thiscategory->name == '') { header("Location: index.php"); die ('<meta http-quiv="refresh" content="0;index.php">'); }
to
$thiscategory = new category('id', $catid); // create proper category object if ($thiscategory->name == '') { header("Location: error.html"); die ('<meta http-quiv="refresh" content="0;index.php">'); }
By bringing up ancient threads you're just misleading more people. There's been a badrequest.tpl template for several versions now. So please, nobody should try to impliment the suggestions of this thread -- it's outdated.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on Removing URLs and Google
Experienced
Usergroup: Customer
Joined: Oct 02, 2003
Total Topics: 33
Total Comments: 97
When google tries to spider a link or cat already in its index which I have recently removed, it is re-directed to my home page. Having numerous "removed" links and cats all pointing with different names to my homepage has caused me to receive a duplicate content penalty on one of my sites. I am using mod-rewrite on 3.12.. The question is there a way to direct non-existing links and cats to a "404" or other error page?
Member
Usergroup: Customer
Joined: Oct 25, 2004
Total Topics: 8
Total Comments: 28
That's a great question. I'd like to know the answer to that one too, because I was concerned about the same thing.
Are you sure that you've got a dup content issue? What are you seeing that indicates so to you...
Forum Regular
Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan
Total Topics: 57
Total Comments: 185
I'd like to set up my own 404 page anyway.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
In index.php find header("Location: index.php");
die ('');
and change index.php to where you want it to go. It can't be a real 404 because index.php itself does exist even if the specific category being requested doesn't.
Will add a 'content does not exist' template in the future.
Experienced
Usergroup: Customer
Joined: Oct 02, 2003
Total Topics: 33
Total Comments: 97
does not seem to work, non-content still goes to index page..
header("Location: index.php");
die ('
Made changes to the index.php found in the main directory..
Am I missing something?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
You didn't actually change the important index.php there, so naturally it still goes to index.php.
That die line is actually incorrect syntax anyhow, needs a url=, but on 99.999% of servers that line won't be reached anyhow.
Experienced
Usergroup: Customer
Joined: Oct 02, 2003
Total Topics: 33
Total Comments: 97
Well, I'm not a programmer so I had to guess at what I was supposed to do.. I came up with this
$thiscategory = new category('id', $catid); // create proper category object
if ($thiscategory->name == '')
{
header("Location: URL=http://mydomain.com/error.html");
die ('');
}
$thiscategory->countview();
I guess you need to spell the instructions out a little clearer for me as this is incorrect...
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
No, what you're doing there is not correct. You need to simply change
header("Location: index.php"); to
header("Location: error.html");
Leave everything else alone. You could add the url= onto the meta
refresh tag, but it will never get used on your server anyhow so
there's no point.
Experienced
Usergroup: Customer
Joined: Oct 02, 2003
Total Topics: 33
Total Comments: 97
Happy holidays everyone...
Paul,
After making the changes, mydomain.com/480 (480 is a no content cat) I get the error.html page. However, if I enter mydomain.com/nocontent I am re-directed to the main page.
Experienced
Usergroup: Customer
Joined: Oct 02, 2003
Total Topics: 33
Total Comments: 97
Is there a fix to the using cat names re-directing? As said before, using cat numbers which do not exist will direct to the error page. If I use a invalid cat name it directs to index.php
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Above if (($action == 'displaycat') && ($catid > 0))
add
if ($action == 'displaycat' && $catid == '')
{
header("Location: error.html");
}
Experienced
Usergroup: Customer
Joined: Oct 02, 2003
Total Topics: 33
Total Comments: 97
Thanks Paul..
removed Cats go to the error.html, however, removed subcats gets a 404 which is ok. Anything is better than going back to index.php.
Forum Regular
Usergroup: Customer
Joined: Jan 21, 2005
Total Topics: 32
Total Comments: 102
i found this thread and i guess i am having the same problem. Most of my google referral are from details pages instead of the main categories page. So is it better to change this :-
$thiscategory = new category('id', $catid); // create proper category object
if ($thiscategory->name == '')
{
header("Location: index.php");
die ('<meta http-quiv="refresh" content="0;index.php">');
}
to
$thiscategory = new category('id', $catid); // create proper category object
if ($thiscategory->name == '')
{
header("Location: error.html");
die ('<meta http-quiv="refresh" content="0;index.php">');
}
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
By bringing up ancient threads you're just misleading more people. There's been a badrequest.tpl template for several versions now. So please, nobody should try to impliment the suggestions of this thread -- it's outdated.