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

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.

图片转代码服务由CSDN问答提供 功能建议

我将我的codignter网站上传到Windows服务器。主页工作正常,但所有其他链接和页面显示

服务器错误 404 - 找不到文件或目录。 您要查找的资源可能已被删除,名称已更改或暂时不可用。 这是我的htaccess文件

 &lt; IfModule mod_rewrite.c&gt; 
Access-Control-Allow-Origin:* 
RewriteEngine On 
RewriteCond%{REQUEST_FILENAME}!-f 
RewriteCond%{REQUEST_FILENAME}!  -d 
RewriteRule ^(。*)$ index.php?/ $ 1 [L] 
&lt; / IfModule&gt; 
&lt; FilesMatch“。(ttf | otf | eot | woff | woff2)$”&gt; 
&lt; IfModule  mod_headers.c&gt; 
从所有
Aeader中设置Access-Control-Allow-Origin“*”
&lt; / IfModule&gt; 
&lt; / FilesMatch&gt; 
   
 
 

它适用于Linux服务器 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>
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题