1 (edited by hussam 2010-06-09 15:36)

Topic: how do I make deleted forum sections or deleted threads return 404?

how do I make deleted forum sections or deleted threads return 410 or 404 error? either using php or htaccess.

reason I am asking is the googlebot now decided to treat "Bad request. The link you followed is incorrect or outdated." forum messages as indexing errors called 'soft 404 error' where googlebot thinks I meant to return 404 but didn't do it properly.

Re: how do I make deleted forum sections or deleted threads return 404?

Try to play with the "message" function in the "<FORUM_ROOT>/include/functions.php" file.

Re: how do I make deleted forum sections or deleted threads return 404?

Hello!

I would also return a 404 error when a topic was deleted. I looked in the file functions.php, but I found nothing interesting.
Do you have an idea?


Thank you.

Re: how do I make deleted forum sections or deleted threads return 404?

Look at viewtopic.php.

Re: how do I make deleted forum sections or deleted threads return 404?

Thank you.

I wrote this in viewtopic.php:

($hook = get_hook('vt_qr_get_topic_info')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if (!$forum_db->num_rows($result))
    {
    header('HTTP/1.1 404 Not Found');
    message($lang_common['Bad request']);
    }

and it seems to work.