404 page

How can I get my 404 page to show up in Google searches? The old website has been removed and replaced by a new website. Now when you search in Google and click on the link you will see this:
https://dilien.com/contact.html
Created a 404 page in blocs and posted it online.

When I remove html at the end of the url then I have the correct page.

I don’t think Google typically index a 404 page. The page is basically just a way of saying they have arrived at an incorrect url.This is all I see at that address:

You would be better off creating a 301 redirect by editing the .htaccess file so it goes to the new address.

3 Likes

I think it’s recommended that 404 isn’t even on the sutemap. You don’t really want it crawled

2 Likes

As Flashman has said you really want to setup 301 redirects.

I normally copy the URLs of key pages of the old site and then redirect them to the new equivalents with 301s when the site is replaced if they have changed.

A 301 redirect will update search engine index’s and also keep your ranking of those pages.

2 Likes

Thanks!!
Found this in the forum and thanks to this link found the good scrips. TOP.

Uploaded the following scripts to the server via .htaccess and everything works as it should.
#http:// to https://
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#www to non-www
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteRule ^(.*)$ https://dilien.com/$1 [L,R=301]

RewriteEngine on RewriteRule ^/?(.*).(html)$ /$1 [R=301,L] RewriteEngine On ErrorDocument 404 https://dilien.com/404/ And everything is working fine.

Hope this is also the right way with regard to Google ranking.

Have another problem see:

1 Like