301 Web中的重定向。配置不起作用

时间:2013-10-21 16:11:18

标签: c# redirect web-config http-status-code-301

我正在从web.config组织我的301重定向。很简单,有关'queries / callabck.aspx'的页面没有重定向到'queries / customer-service.aspx'。 我环顾了几个小时。我想知道你是否有任何想法让我离开?

<?xml version="1.0" encoding="UTF-8"?>

<configuration>
  <location path="enquires/callback.aspx">
    <system.webServer>
      <httpRedirect enabled="true" destination="/enquiries/customer-service.aspx" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>

 <appSettings />
    <connectionStrings>
      <add name="ConnectionString" connectionString="*removed for security**" />
    </connectionStrings>

<system.web>
    <!-- 
        Set compilation debug="true" to insert debugging 
        symbols into the compiled page. Because this 
        affects performance, set this value to true only 
        during development.
    -->
    <compilation debug="true" defaultLanguage="c#" />
    <!--
        The <authentication> section enables configuration 
        of the security authentication mode used by 
        ASP.NET to identify an incoming user. 
    -->
    <authentication mode="Windows" />
    <!--
        The <customErrors> section enables configuration 
        of what to do if/when an unhandled error occurs 
        during the execution of a request. Specifically, 
        it enables developers to configure html error pages 
        to be displayed in place of a error stack trace.
    -->
    <customErrors mode="Off">
        <error statusCode="403" redirect="NoAccess.htm" />
        <error statusCode="404" redirect="/404.aspx" />
        <error statusCode="500" redirect="/500.aspx" />
    </customErrors>

</system.web>
<system.webServer>
    <defaultDocument>
        <files>
            <add value="index.aspx" />
        </files>
    </defaultDocument>
</system.webServer>

0 个答案:

没有答案