Testing your redirects and rules
This page is part of the extended installation guide for our
smart 404
management script and deals with testing your redirects and rules by directly
accessing the script, allowing you to test your implementation before committing
to using it as part of the site infrastructure.
Before you start
The basic assumptions at this point are that you've installed the script and the
basic script appears to be working correctly. The steps detailed below will work
whether the script has been assigned to handle 404s or not as we'll be accessing
the script directly.
URL Structure
There's not really that much to testing your 404 script and it's rules once it's
been configured correctly - you just need to open your browser, paste in a correctly
structured URL and then check the results.
How do you build a correctly structured URL to test with? Well...
Obviously you'll need to remember where you've put your 404 script, for our examples
we'll assume that the path is
http://example.com/my404.asp
and that your site's root is
http://example.com/.
Next you'll need to make a list of the redirects and rules you want to test, when you
use them later they'll need to be fully-qualified, so instead of
/myFolder/page.htm
they'd read
http://example.com/myFolder/page.htm.
Finally to test we merge the two elements from above and produce a URL which looks
something like this;
http://example.com/my404.asp?404;http://example.com/myFolder/page.htm
The querystring structure is identical to that used internally by IIS when it calls
the 404 script, it starts with the path to the script itself followed by a querystring
which starts with the HTTP status code generated followed by a semi-colon followed
by the URL originally requested.
In theory that all means you should be able to test your script fairly easily and
observe the results just as easily provided that the server you're testing with
has all the required files that will be used by the script on the live server.