I have a website that is constantly updated and the problem is that the Google bot that indexes the website gives a lot of 404/500 errors when a image does not exist anymore or has been deleted. It's a product catalogue website, so products get deleted and added on a hourly basis.
I've tried this RewriteRule
^/(.*)$ /site/page/view/404 [R=301,L]
which causes all images on the website not to display any more or
^(.*) /site/page/view/404 [R=301,L]
which just gives error 500 on the browser.
Is there a way to match non existent files/urls and redirect them permanently to different url e.g. /site/page/view/404
Try this (assuming
.htaccess
is in web root)Alternatively, you can use
ErrorDocument
as well.