I just did the following in htaccess:
ErrorDocument 404 http://www.website.com
My first question is, it is OK for me to do this?
If there are any SEO/etc., etc. problems with redirecting 404’s to
the homepage let me know.
Second question:
The thing is I have a one-page site and I’d like to keep it that way.
What I would like to do is have a popup div show up, as an alternative to a 404 page.
So basically 404’s get redirected to the homepage, where a popup then fades in with whatever 404 message in it.
How could I trigger the popup? The jquery code would somehow have to know that the user ended up here due to a 404. Is this even doable?
(I can manage the popup itself, but how to tell it to show up after
a 404 happens.)
You can add a query string to the URL that you’re using as the 404 page.
.htaccess
Then, check to see if the variable is set to the proper value and if it is, create a variable in javascript.
Javascript/PHP