Php .htaccess链接到根目录

Php .htaccess链接到根目录,php,.htaccess,codeigniter,ftp,Php,.htaccess,Codeigniter,Ftp,我使用FTP将codeigniter网站上传到服务器。我已将FTP中的文件安排如下(我没有10个在重复竞争中): php查找系统和应用程序文件夹。但我不知道如何处理.htaccess文件。我尝试过网络上的各种例子,下面是一个例子: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteCond %{REQUEST_URI} !^/public_html/ RewriteCond %{REQUEST_F

我使用FTP将codeigniter网站上传到服务器。我已将FTP中的文件安排如下(我没有10个在重复竞争中):

php查找系统和应用程序文件夹。但我不知道如何处理.htaccess文件。我尝试过网络上的各种例子,下面是一个例子:

RewriteEngine on  
RewriteCond %{HTTP_HOST} ^(www.)?example.com$ 
RewriteCond %{REQUEST_URI} !^/public_html/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /public_html/$1  
RewriteCond %{HTTP_HOST} ^(www.)?example.com$ 
RewriteRule ^(/)?$ public_html/index.php [L]
这是我第一次使用codeigniter,这个问题可能很愚蠢(对不起)。我真的很感谢我能得到的所有帮助

我现在有另一个.htaccess文件,它从url中删除index.php:

RewriteEngine On
RewriteBase /example.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

如果要从URL中删除
index.php
,请在.htaccess中使用以下代码

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

如果要从URL中删除
index.php
,请在.htaccess中使用以下代码

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
抄袭

所以问题不在于.htaccess!我做了一个 第一个字母是大写字母

抄袭

所以问题不在于.htaccess!我做了一个 第一个字母是大写字母


@user3066691应用程序和系统文件夹应该是公共的\u html请将整个项目上传到公共的\u html文件夹中。没关系,我也试过了,我也得到了同样的结果result@user3066691应用程序和系统文件夹应该是公共的\u html请将整个项目上传到公共的\u html文件夹中,我也试过了,得到了同样的结果你在
index.php
中定义了正确的路径吗?是的,这不是问题:)你在
index.php
中定义了正确的路径吗?是的,这不是问题:)