Search code examples
search-engine

Is PHP Routing with similar_text bad for search engines?


My website should only have one index.php that checks the requested URL and displays the right content via include(...) respectively.

Right now I am using similar_text for URLs that doesn't exist on website. Than the most simliar path should be choosen.

But I heard that simliar URLs that gives the same content aren't good for search engines.

So does it have a bad effect to search engines like Google?


Solution

  • All urls with the same content are counted as double. You should return 404 not found header for all urls wich do not mach exactly with yours.

    header('HTTP/1.0 404 Not Found');
    echo "<h1>Error 404 Not Found</h1>";
    

    More detailes about google's attitude see in documentation