无法在000webhost.com中打开控制器(PHP网页)。“error404.000webhost.com/”

无法在000webhost.com中打开控制器(PHP网页)。“error404.000webhost.com/”,php,.htaccess,codeigniter,web-hosting,Php,.htaccess,Codeigniter,Web Hosting,我刚刚将我测试网站的所有文件上传到000webhost.com域。 我的网站是farazphptest.comxa.com 在上传网站之前,我正在研究Codeigniter。我的所有控制器在本地主机上都工作正常,但在服务器上上载站点后,当我尝试访问一个控制器时,比如farazphptest.comxa.com/welcome,其中welcome是我的网页/控制器,它不工作并打开error404.000webhost.com/?包括welcome在内的所有控制器在localhost上都运行良好,但

我刚刚将我测试网站的所有文件上传到000webhost.com域。 我的网站是farazphptest.comxa.com

在上传网站之前,我正在研究Codeigniter。我的所有控制器在本地主机上都工作正常,但在服务器上上载站点后,当我尝试访问一个控制器时,比如farazphptest.comxa.com/welcome,其中welcome是我的网页/控制器,它不工作并打开error404.000webhost.com/?包括welcome在内的所有控制器在localhost上都运行良好,但在将网站上传到域上之后,只有主页可以完美加载。 这是我第一次把一个网站放到网上,如果我错过了一些技巧,一定要告诉我。我只是简单地在网上复制了我的文件。谢谢

这是我的.htaccess文件,用于本地主机和服务器上

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /faraztest
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 /faraztest/index.php
</IfModule>

另一种解决方案是使用项目名称在000webhost.com上创建子域,并直接从子域url调用该项目,如下所示:

从Cpanel到子域 创建具有项目文件夹名称的新子域。ex:test.farazphptest.comxa.com 用项目文件夹覆盖创建的子域文件夹。例:测试 在主上载项目文件夹中编辑.htaccess,如下所示: 现在,您可以直接从新的子域url调用您的项目。
例:http://test.farazphptest.comxa.com以下内容解决了我的问题

我的.htccess文件是

# index file can be index.php, home.php, default.php etc.
DirectoryIndex index.php

# Rewrite engine
RewriteEngine On

# condition with escaping special chars
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

而且它很有魅力

是您的本地主机windows和Web主机linux。Windows与linux一样不区分大小写。对于windows控制器和控制器是相同的,这在linux中是不正确的。@ArtisiticPhoenix我重命名了控制器文件夹名。错误仍然存在。这适用于所有内容,包括控制器的文件名,是Welcome.php还是Welcome.php.yes man!我已经测试了@artisiticpoe的所有内容。如果这个问题没有像病毒一样传播,你能帮我解决这个问题吗@Artisticicphoenix
# index file can be index.php, home.php, default.php etc.
DirectoryIndex index.php

# Rewrite engine
RewriteEngine On

# condition with escaping special chars
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]