duanbei3704 2019-02-02 09:32
浏览 110
已采纳

404 - 找不到文件或目录。 Windows服务器上的Codeigniter [关闭]

i uploaded my codignter website to a windows server.And home page is working fine,but all other links and pages showing

Server Error 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. Here is my htaccess file

<IfModule mod_rewrite.c>
Access-Control-Allow-Origin:*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<FilesMatch ".(ttf|otf|eot|woff|woff2)$">
<IfModule mod_headers.c>
Allow from all
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>

its works on Linux server please help.

  • 写回答

1条回答 默认 最新

  • donglv7097 2019-02-02 10:46
    关注

    make a file web.config

    <?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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何实验stm32主通道和互补通道独立输出
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题