Articles on: Problems & Errors

Unexpected Page Redirect Error Caused by Test Scenario Misconfiguration

Question / Issue: Why does my monitor (Test Scenario) report a failure event due to a page redirect but when I open up the page in my internet browser, the page loads just fine?

Symptoms/Cause: When people type a web address, sometimes they don't explicitly type out a default file. For instance, if you type out "http://www.mysite.com/dir/", the server receiving the request will automatically load a default file (commanly named "default.asp" or "index.php" depending on the Web Server).

Sometimes people will go one step further and leave off the last forward-slash when typing an address. For example: "http://www.mysite.com/dir". In this circumstance, web servers are not as forgiving. When a Web Server receives this request, it will first assume that "dir" is actually a file name (since there is no forward slash after it), so it will look for a file in the main directory called "dir". If it can't find that file, it will then check to see if there is a directory by that name. If there is a directory by that name, the web server sends a HTTP 302 redirect command back to the client to tell the client that there is no file named "dir" but they should try requesting the "dir" directory instead. This HTTP 302 redirect command will ask the client to request the "http://www.mysite.com/dir/" URL instead. ... Take notice that the only difference between this URL and the first URL is that it ends with a forward-slash which means you want to request the default or index file for the directory.

The reason why your personal internet browser does not report a problem when you manually load a URL like that is because it automatically follows those redirect commands without asking you.

Answer / Solution: Here's how this relates to your problem and the way you configured your Test Scenario(s). When creating or editing a Test Scenario, there is a field that asks you to enter the URL file "Path" value. Just as in the example above, if you do not add a forward-slash to the last directory in your path, your server will assume that you are requesting a file name and not a directory. The server will then go through the process mentioned above and send back a HTTP 302 redirect command.

If you have "Follow Redirects" disabled in your Test Scenario, our Test Stations will interpret this HTTP 203 redirect command as an error and will proceed to alert you of this Test Failure.

The recommended solution is not to enable Follow Redirects, but instead to add a foward-slash to the end of the last directory in your URL file path. This way you avoid this redirect problem altogether and can still be alerted if an unintended redirect accures as a result of a real failure.

Here are some example of how to correct this issue:
URL Path Error = abc
Fixed URL Path = abc/

URL Path Error = abc?meg=1&sd=5
Fixed URL Path = abc/?meg=1&sd=5

Related Links
Monitor Failure Due to Redirect on Non-Redirecting Web Page
HTTP 404 Error When Following a Page Redirect

Updated on: 10/10/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!