简体   繁体   中英

IIS 7.5: Replace web app with redirect to another

Hello - I'm using IIS 7.5 to host a web site with several web apps. For the sake of discussion, let's say it is comprised of the following:

http://hostname/app1

http://hostname/app2

I have a bunch of users that use http://hostname/app1 as their bookmarked hyperlink but I want to delete that app and replace it with app2. In my case, app2 has a more appropriate name so I can't just overwrite app1's content.

Is there a way to redirect users to app2 when they browse to app1 within IIS? I tried the Http Redirect but it appears to work for the whole website and I just want to apply it to one application. I see the Url Rewrite tool but it seems like overkill and I'm just trying to replace a visit to the app's main page, not rewrite urls...

Thanks!

You could in theory, empty your site's pages and replace their content with:

<meta http-equiv="refresh" content="0; url=http://hostname/app2" />

If you are looking for a catch-all scenario, URL Rewrites would be ideal. For example http://hostname/app1/page1 http://hostname/app1/page2 may not get caught with below without replacement in both places.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM