How to fix error 404 in google console ? how can i do it by code? - letsdiskuss
Official Letsdiskuss Logo
Official Letsdiskuss Logo


vitaly shvartzman

gaming blogger | Posted on | Science-Technology

How to fix error 404 in google console ? how can i do it by code?


Stack Developer | Posted on

Firstly you should know about 404 error before solving it: “Error 404” (or “Page Not Found”) – is a standard HTTP status code that occurs when the server can’t find the document requested by a user. Basically, this is a page that doesn’t exist.Google Search Console is a tool in which you can check website for google analytics, seo, etc, for solving 404 error in this we can do some things:Firstly, check all broken links of website and if any occur try to eliminate by robots.txt file.Secondly, create a custom error 404 page, if still any 404 page remains in this situation you can redirect those pages to this 404 page like this. Third, if you want to it by code than you have to follow these below stepsLook for URLs just bottom of the page. If it’s Simple Tag issue then try adding tag manually to respective related posts and issue should resolve.If there is an issue with main post URLs then follow below steps:Open your blog’s .htaccess file which will be in your site’s root folder mainly under public_html folderAdd 301 Moved Permanently to it. 301 means current links or records using the URL that the response is received for should be updated.Google recommends using a 301 redirect to change the URL of a page as it is shown in search engine results.Format:Redirect 301 "Old dead link" "New working link"


Picture of the author