If I understand what you're trying to do correctly, at first glance it seems like this is something more properly handled on the server side (by either web server configuration -- i.e. customized 404 pages or some kind of server side scripting scheme).
How do you know that they typed the "wrong" number in? Does wrong mean that the page doesn't exist?
The only thing that occurs to me you could do on the client side is put the acceptable pages in a structure (like an array) and compare what the client types in against the array's contents, sending him/her to the default page if there is no match. However, this alone becomes problematic if there are a large number of correct entries and/or the entries change frequently.
A slightly better solution would be to generate the initial page from a CGI script that would use a scheme (like simply reading all the files in a directory that represent acceptable entries) for generating the array. Or even better, creating a list box or combo box and putting the entries into that, so the client can just choose one of the correct entries.