【问题标题】:Getting internal server error when setting up .htaccess file to web.config file将 .htaccess 文件设置为 web.config 文件时出现内部服务器错误
【发布时间】:2017-03-29 13:07:30
【问题描述】:

我正在尝试在 Windows 服务器上上传 codeigniter 项目。当我在 Windows 服务器上上传项目时,我的索引页面运行良好,但是当我输入用户名和密码登录页面时,会出现错误消息。

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       BeginRequest
Handler    Not yet determined
Error Code     0x80070003
Config Error       Cannot read configuration file
Config File    \\?\D:\Inetpub\vhosts\sp-tapi.in\clean-note.rudra-infotech.com\test\web.config
Requested URL      http://clean-note.rudra-infotech.com:80/test
Physical Path      D:\Inetpub\vhosts\sp-tapi.in\clean-note.rudra-infotech.com\test
Logon Method       Not yet determined
Logon User     Not yet determined

我已将 .htaccess 文件转换为 IIS 服务器的 web.config 文件(使用 IIS 8.5) 我的 web.config 文件是

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="rule 1S" stopProcessing="true">
<match url="^(.*)$"  />
<action type="Rewrite" url="/index.php/{R:1}"  appendQueryString="true" />
</rule>

      </rules>
    </rewrite>
    <httpErrors>
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" path="/somedir/oops404.htm" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>
  <system.web>
    <customErrors mode="Off" />
  </system.web>
</configuration>

【问题讨论】:

    标签: php .htaccess codeigniter iis web-config


    【解决方案1】:

    我有同样的问题,请检查这个修改,它对我有用。

            <?xml version="1.0" encoding="UTF-8"?>
        <configuration>
    
        <system.webServer>
    
            <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    
        <rewrite>
        <rules>
            <rule name="RuleRemoveIndex" 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" />
                </conditions>
                <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true"/>
            </rule>
        </rules>
        </rewrite>
    
    </system.webServer>
    
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
    
    </configuration>
    

    【讨论】:

    • 我根据你的回答修改了 web.config 文件,但是它不起作用。
    • 我解决了浏览器在呼叫控制器之前自动包含空间的问题。喜欢它。 abc-rudra-infotech.com/%20test
    • 谢谢。它也帮助我找到了我的问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-26
    • 2015-11-25
    • 1970-01-01
    • 2010-10-07
    • 2014-12-14
    相关资源
    最近更新 更多