问题
On our old IIS6 server, we handled IIS redirects by:
- Setting up a virtual directory on the site
- Pointing the virtual directory to a physical path on the server
- In the VD properties, set it to redirect to a URL
I'm trying to replicate this in IIS7 by doing the following:
- Set up a virtual directory on the site
- Point the virtual directory to a physical path on the server
- In the VD features, double click on HTTP Redirect and add the URL to redirect to.
This works fine if I only have one virtual directory. If I add another, the settings in the second VD overwrite the settings of the first!
Is this a common issue, and has anyone found a workaround? Anything would be appreciated.
回答1:
When you configure an HTTP Redirect in IIS 7 for a Virtual Directory it creates a web.config file in the physical path. The work around is to point each Virtual Directory to a unique physical path.
I use folder structure like this: \path\redirects[site_name][virtual_dir_name]
来源:https://stackoverflow.com/questions/17943998/iis7-virtual-directory-redirects