Link to home
Start Free TrialLog in
Avatar of WinPE
WinPE

asked on

How do I redirect all incoming url requests to a single iis page?

How do I redirect all incoming url requests to a single iis page?

Say any requests going to
http://example.com/example1
http://example.com/example1/example1-2/
http://example.com/example1/example1-3/exampl.htm
When these links are actualy not present...

to a single htm file iisexample.htm?

Is there a wildcard or rewrite I can throw in there to do this? Asside from redirecting all 403 errors to the page?
Avatar of David Scott, MCSE
David Scott, MCSE
Flag of United States of America image

I would suggest that you create virtual directories for each of these URL's in IIS and then in the preferences for each of the virtual directories, on the "Home Directory" tab select "A redirecton to a URL" under the heading "The content for this resource should come from:".  This will allow you to redirect all traffic to the virtual directory to a specific page.  Just enter URL to the page in the "Redirect to:" textbox.

Another option is to create the virtual directories and have the document specified as the main default content page be the redirection.  To do this, update the "Documents" tab in the preferences for a virtual directory and specify a page to be the default content page.  Then right click on the page in IIS and select properties.  On the "File" tab, select "A redirection to a URL" and enter the location to redirect to.

Let me know if you need further clarification.

Avatar of WinPE
WinPE

ASKER

Hey guys thanks for the answers, I'll check out the first website today. As far as virtual directories, that won't work. In our case there used to be an old website run by another group, the group no longer manages it (we have no access to it, and we run the new updated version). So we have no way to know the directory strucutre. So there might be old links out there we need to catch, but have no idea what they are. So we can't create the virtual directories.
If it's an IIS site, you can redirect all traffic to the site to a url by updating the preferences.
Avatar of WinPE

ASKER

It is an IIS site, how do I do that?
ASKER CERTIFIED SOLUTION
Avatar of michman
michman
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WinPE

ASKER

I need to redirect it to a single htm file on that server. When I use the above method, it causes a loop to form.
You could update the default page or folder preferences for the sites that you want to redirect from so they point to the URL of your choice.
Using the URL examples you provided above, In IIS you should see the web site example.com and a virtual directory for example1.  Update the preferences for example1 so all content is redirected to a url of your choice.
Avatar of WinPE

ASKER

Ok I figured out how to do it. Thanks to both of you. The iis redirect works but will send it into a loop if on the same box. All you have to do is take the default start page and for it's redirection you add a wildcard to end the loop.

Redirect to: *;!

Thanks Again