« Previous Next »

Answered Thread: Redirect multiple paths

Last post 10-21-2009 2:03 AM by softbossen. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 10-20-2009, 11:01 AM

    Redirect multiple paths

    My company is having a website with lots of paths leading to different urls. The paths are suppose to redirect to web pages both within the server and on other servers.
    I.e.
    www.domain.com/path1 --> www.domain.com/default.aspx?id=16532 or
    www.domain.com/path2 --> www.anotherdomain.comI´ve figured out that I could write everything in web.config. Like this:
    <configuration>
        <system.webServer>
            <httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Permanent">
      <add wildcard="*path1" destination="default.aspx?id=16532" />
      <add wildcard="*path2" destination="
    http://www.anotherdomain.com" />
     </httpRedirect>
        </system.webServer>
    </configuration>
    The problem is that I don´t want to edit web.config every time a new path redirect has to be added.Is there any way I can create another config-file and make some kind of reference to it? I mean a config-file in another directory, but I want the real web.config to read certain info from it.

    Is this possible?

    Thanx
  • 10-20-2009, 1:40 PM In reply to

    Answered Re: Redirect multiple paths

    Have you looked at using the URL Rewrite module?

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 10-21-2009, 2:03 AM In reply to

    Re: Redirect multiple paths

    jeff@zina.com:

    Have you looked at using the URL Rewrite module?

    Jeff

    A little, but I thought URL Rewrite module only works with redirection of web pages on the same server/domain?

Page 1 of 1 (3 items)
Microsoft Communities