Need to avoid redirect to webhost homepage

Hello, I never really gave a serious thought to the above question until now that I’m trying to actually launch a live site. Well I’m sure most of you are familiar with this situation, where a user my enter a wrong, non existent url, whose root happens to be your domain name. For example, instead of entering domain.com/greetings, the user may wrongly type domain.com/grewtings . How can I make my site to redirect such erroneous urls to my homepage, instead of to my webhost’s homepage with an error message?

Appreciate all answers.

If your webhost uses Apache (which is very likely), you can use an .htaccess file:

ErrorDocument 404 /index.php

Thanks fellows for all the suggestions. I managed to get it working :smiley:

Sponsor our Newsletter | Privacy Policy | Terms of Service