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

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效