Configure Apache to redirect to the home page if a user is directed to a broken link?

Is there a way to configure Apache so that if a user tries to access a webpage that doesn’t exist under mydomain.com, that it redirects that user to the index.php?

Place something like this within the appropriate conf file tags (e.g. “<VirtualHost *> … </VirtualHost>”).

ErrorDocument 404 /index.php

Modify to suit your particular circumstances.