gpt4 book ai didi

codeigniter - codeigniter在本地但在Web服务器上无法正常工作。 404错误

转载 作者:行者123 更新时间:2023-12-04 03:07:54 25 4
gpt4 key购买 nike

Codeigniter在本地服务器上工作正常,但在Web服务器上工作不正常。

我使用XAMPP在本地进行开发。

我正在使用Microsoft Windows的Parallels Plesk Panel 11.0.9。

尚未加载codeigniter的 404错误页面。网址是服务器的loadind 404错误页面。我已经删除了根目录的所有 .htacces 重写规则,并包括了 index.php仍然无法正常工作。

搜索了很多但找不到正确的解决方案

Codeigniter文件夹的目录(站点,应用程序,系统)


mysite/httpdocs/demo/test/

mysite/httpdocs/demo/test/application/config/config.php中的基本URL
$config['base_url'] = 'http://mysite/httpdocs/demo/test/site/';

在mysite/httpdocs/demo/test/application/.htaccess中
Deny from all

在index.php中设置的环境(mysite/httpdocs/demo/test/site/index.php)
switch (dirname(__FILE__)) {
case 'http://mysite/httpdocs/demo/test/site':
define('ENVIRONMENT', 'development');
break;

default:
define('ENVIRONMENT', 'production');
break;
}
$system_path = '../system';
$application_folder = '../application';

在mysite/httpdocs/demo/test/site/.htaccess中
               <IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

在mysite/httpdocs/demo/test/application/config/routes.php中
           $route['default_controller'] = "page";
$route['404_override'] = 'page';
$route['article/(:num)/(:any)'] = 'article/index/$1/$2';

我给网址mysite/demo/test/site和
而不是codeigniter 的Web服务器给出的404错误页面

我在哪里错了?

最佳答案

我联系了我的房东。他们说php处理程序有问题。

除了此IIS不会读取.htaccess文件之外,我在mysite/httpdocs/demo/test/site/中将文件web.config替换为.htaccess
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>

现在,该网站已启动并正在运行。 感谢您的支持

关于codeigniter - codeigniter在本地但在Web服务器上无法正常工作。 404错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17630669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com