1

I need to custom error 404 redirection. My webconfig is:

 <customErrors mode="On">
  <error statusCode="404" redirect="~/Errors/Error404.aspx" />
    </customErrors>

I will delete this page /service/reservation.aspx and i would like when a client go to this page it will be redirected to /service/newreservation.aspx an in other case will be redirected to /Errors/Error404.aspx. I'm using IIS6 and wouldn' like to install any iis extension (because i have about 60 server)

How can do this please?

3
  • What is the problem you are facing now ? Commented Jun 21, 2013 at 12:21
  • i need a redirection to the page /service/newreservation.aspx when i access to /service/reservation.aspx and to /Errors/Error404.aspx in others 404 errors cases Commented Jun 21, 2013 at 12:29
  • I think , you would need to keep reservatin.aspx and redirect permanently. Check this link Not sure if there are other ways to do it. Commented Jun 21, 2013 at 12:44

2 Answers 2

1

You can set URL rewrite module and set rules for that. Instead of relying on custom error.

Here is the link how you can install IIS rewrite module in IIS 6.

http://www.web-site-scripts.com/knowledge-base/article/AA-00461/0/Installation-of-URL-Rewriting-module-IIRF-for-IIS6-IIS7.html#iis56

Sign up to request clarification or add additional context in comments.

2 Comments

I have 60 serves, so i prefer to found a code solution o webconfig without installing anything
Then write a http module and check every request whether it contains url like /service/reservation.aspx and if it that then rewrite the redirect path to it to service/newreservation.aspx
0

Since you are deleting the old page, you can set up your own javascript redirect to handle 404's:

Set the Custom Errors in IIS6 to point to an HTML file.

In that file, write a javascript redirect:

<script type="text/javascript">
  var url = document.URL;
  if(url.match("/service/reservation.aspx$"))
  {
      window.location.href = "/service/newreservation.aspx";
  }
  else
  {
      window.location.href = "/Errors/Error404.aspx";

  }
</script>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.