C# 要使用301重定向将页面从旧域重定向到新域吗

C# 要使用301重定向将页面从旧域重定向到新域吗,c#,asp.net,asp.net-mvc,C#,Asp.net,Asp.net Mvc,我有两个域名 1.rameshmehndi.com(旧版) 2.mehndigoa.com(新) 我想用301重定向将一些页面从旧域重定向到新域 例如 如何使用web.config实现这一点 <configuration> <location path="services.htm"> <system.webServer> <httpRedirect enabled="true" destination="http://do

我有两个域名 1.rameshmehndi.com(旧版) 2.mehndigoa.com(新)

我想用301重定向将一些页面从旧域重定向到新域

例如

如何使用web.config实现这一点

    <configuration>
  <location path="services.htm">
    <system.webServer>
      <httpRedirect enabled="true" destination="http://domain.com/services" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>
  <location path="products.htm">
    <system.webServer>
      <httpRedirect enabled="true" destination="http://domain.com/products" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>
</configuration>


上述代码不起作用

可能是,将配置值替换为实际值?可能的重复除了遵循上面的链接并使用解决方案外,您还需要在服务器上安装。