简体   繁体   中英

Redirect web.config IIS 8

I tried to make a redirect in web.config, but I get a 500 error. The version of IIS is 8.5, but before I was on version 6. What is wrong with this syntax ?

    <location path="Test/test.aspx">
<system.webServer>
<httpRedirect enabled="true" destination="http://domain/Test/IT/test.aspx" httpResponseStatus="Permanent" />
</system.webServer>
</location>

I get an this error message : Internal error - 500. I deleted the lines in web.config and everything works again.

I tried URL Rewrite feature, but I get an error.

"Cannot read configuration file due to insufficient permissions"

I am trying to fix with these instructions below, but the system asked me for user/password. I am as administrator, but those credentials didn't work.

Cannot read configuration file due to insufficient permissions

The HttpRedirectionModule is installed in the server. Also, RewriteModule

Did you install the HttpRedirect module? It is optional under IIS7+.

If that isn't it would help if you could post the detailed error message you get from hitting this locally if you can -- that will help narrow down the cause.

Finally, you might want to look into URL rewriting here, it is a new feature for IIS7+ that can handle simple url redirects like the above and much more.

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