PDA

View Full Version : Soft 404 URL Errors



David Mundle
June 4, 2018, 09:10 AM
Hello Guys

We seem to be having issues regarding indexing of urls according to google webmaster tools, we keep getting error messages about Soft 404 errors and resulting in these urls not being indexed?

Can someone explain why this is please as it will need fixing or sorting out ASAP. Thanks David

Rudi
June 4, 2018, 11:21 AM
Hello,

You can use this script for redirecting 404 urls:



if( substr_count( $_SERVER['REQUEST_URI'], 'ERROR_PATH' ) > 0 )
{
$redirect_link = str_replace( 'ERROR_PATH', 'CORRECT_PATH', $_SERVER['REQUEST_URI'] );

header("HTTP/1.1 301 Moved Permanently");
header("Location:" . rtrim(RL_URL_HOME, '/') . $redirect_link );
exit();
}


replace ERROR_PATH and CORRECT_PATH with your paths respectively and run error url on your site
then in google webmaster marked error links as fixed

David Mundle
June 4, 2018, 11:29 AM
Hi Rudi

I am not sure where this code is suppose to go but this issue came about when i updated my categories list and previous categories got indexed and are not in use anymore, can you place this code for me?

Thanks
David

Rudi
June 4, 2018, 11:44 AM
you can place it in includes > controllers > common.inc.php (at the top)

in case when you don't need to use some categories you can do like that:



if( substr_count( $_SERVER['REQUEST_URI'], 'ERROR_PATH' ) > 0 )
{
header("HTTP/1.1 301 Moved Permanently");
header("Location:" . RL_URL_HOME );
exit();
}

David Mundle
June 4, 2018, 11:48 AM
Sorry Rudi

I am still learning however i would prefer someone with more skills that understand this to sort this out for me, code don't mean anything to me right now? And what do you mean by in case when you don't need to use some categories you can do like that: ? This is why i get confused.

Rudi
June 4, 2018, 11:54 AM
Could you create a ticket and list all the error urls and we'll fix them

because here on forum, all the given solutions you're expected to apply yourself

David Mundle
June 4, 2018, 11:54 AM
Okay doing that now..

David Mundle
June 4, 2018, 12:09 PM
Ticket sent Rudi...............Thanks