Mobile app version of vmapp.org
Login or Join
Harper822

: Can a website meet standards without a single link returning 404 status? According to woorank.com seo tools, I read that its not best practice for a website to not have a custom 404 error

@Harper822

Posted in: #410Gone #Code #Http #Standards

According to woorank.com seo tools, I read that its not best practice for a website to not have a custom 404 error page. But here's why I don't have it on a domain.

Currently I and one other person manages the contents of the domain, which includes generating and removing URLs automatically.

For example, Say the site is about food and the other person decides to add fruit to the site. Then a page is automatically generated and this URL is then created and accessible:
example.com/fruit

Then he adds apples and oranges. These URLs are then created:
example.com/fruit/apples http://example.com/fruit/oranges


Then he adds vegetables. These URLs are then created:
example.com/vegetables

Then he adds carrots and celery. These URLs are then created:
example.com/vegetables/carrots http://example.com/vegetables/celery


Therefore these URLs in total will exist:
example.com http://example.com/fruit example.com/fruit/apples http://example.com/fruit/oranges example.com/vegetables http://example.com/vegetables/carrots example.com/vegetables/celery

Later on, he decides to no longer have carrots or oranges. This means the accessible URLs are now:
example.com http://example.com/fruit example.com/fruit/apples http://example.com/vegetables example.com/vegetables/celery

and these ones should return status 410:
example.com/fruit/oranges http://example.com/vegetables/carrots


and in an ideal sense, the rest of the URLs not listed should return 404 status.

When he decides to remove a food category or a food item, it will likely never be added again in the future.

The only way I feel I can pull this off properly is to configure mod_rewrite to return status 404 by default to URLs not listed, and the ones that recently are removed should be stored in a database so that it is checked before returning back a 404.

My line in .htaccess would look like this:

RewriteRule ^(.*)/(.*)$ /loadpage.php?foodcategory=&food= [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^$ /homepage.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ - [R=404,L]


My question then is this...

Is it okay (standard wise) to give a page with http 410 status code for an entire domain for URLs that don't exist on it or must I give an http 404 status code for URLs that never existed before on the domain and flood my database with old URLs that are removed and give http 410 status to them?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Harper822

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sue5673885

According to Google & in the context of SEO,
In case of 404, the page is retained 24 hours before being considered as deleted.
In case of 410, the page is considered as deleted right away.

I guess for a big online shop it can make a difference for product pages that are gone. If the product are discontinued a 410 would be normal. In fact, it is possible to code 410 http codes for a category of pages in wordpress using php or the 410 plugin.

reference from Google:

10% popularity Vote Up Vote Down


 

@Alves908

A 404 or 410 is fine for any page or URL that does not exist. You do not have to mix the two- you can chose just one.

If the page is gone, then a 410 is certainly appropriate, however, a 404 is automatic (as well as traditional as a result) and fine too. Just know that Google, for example, will try for a number of times before delisting any URL from the index. In the meantime, it will be dropped from the SERPs for anything that does not appear to be temporary- that is, 404ed several times consistently. Google will sometimes sample a page more frequently when a 404 is issued or in the case of several 404ed pages, sample a wider set to ensure that there is not a wholesale site change that it should be aware of.

I would say which ever is easiest. If you can 410 all non-existent URLs, then that would be great- otherwise go for a 404 which should be easier but require more failed attempts overall for the same effect.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme