1&1 Windows hosting Server web.config URL rewrite

2020-07-23 08:52发布

问题:

I am facing an issue related to URL rewrite in windows server hosted by 1&1. i am trying to rewrite the urls using web.config file but it's not working at all giving me the error or 500.19

Error Summary HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x8007000d Config Error
Config File \?\E:\kunden\homepages\0\d637982794\www\flight2day\web.config

Requested URL https://flight2day.co.uk:443/ Physical Path
Logon Method Not yet determined Logon User Not yet determined Failed Request Tracing Log Directory faultRequestLogPath

here is the web.config code

<configuration>
    <system.webServer>
        <security>
          <authentication>
             <basicAuthentication enabled="false" />
          </authentication>
       </security>
        <modules runAllManagedModulesForAllRequests="true" >
          <remove name="UrlRoutingModule"/>    
        </modules>
        <rewrite>
              <rules>
                  <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions>
                      <add input="{HTTP_HOST}" pattern="^flight2day\.co.uk$" />
                    </conditions>
                    <action type="Redirect" redirectType="Permanent" url="https://www.flight2day.co.uk/{R:1}" />
                  </rule>
                  <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions>
                      <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                      <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
                  </rule>
                </rules>
        </rewrite>
        <defaultDocument enabled="true">
            <files>
                <clear />
                <add value="index.php" />
                <add value="index.aspx" />
                <add value="index.asp" />
                <add value="index.htm" />
                <add value="index.html" />
                <add value="home.aspx" />
                <add value="home.asp" />
                <add value="home.htm" />
                <add value="home.html" />
                <add value="default.aspx" />
                <add value="default.asp" />
                <add value="default.htm" />
                <add value="default.html" />
            </files>
        </defaultDocument>
    </system.webServer>


</configuration>

here is .htaccess code

<IfModule mod_rewrite.c>
 Options +SymLinks
 AddType x-mapp-php5 .php
 RewriteEngine On
 RewriteBase /
</IfModule>