403将codeigniter移动到实时服务器时出错

403将codeigniter移动到实时服务器时出错,codeigniter,http-status-code-403,Codeigniter,Http Status Code 403,我有一个Codeigniter站点,可以在我本地的XAMPP服务器上正常工作,但现在我已经将其移动到共享主机,当我点击任何链接时,会出现403禁止的错误。主页显示良好,但任何带有slug的页面都会产生403错误。例如 http://xxxxxxxxxxx/~test/ 很好 http://xxxxxxxxxxx/~test/about-us 产生403错误 我看到了,但我的应用程序文件夹及其子文件夹和文件都已拥有755的权限 我的基本Url设置为 http://xxxxxxxxxxx/~te

我有一个Codeigniter站点,可以在我本地的XAMPP服务器上正常工作,但现在我已经将其移动到共享主机,当我点击任何链接时,会出现403禁止的错误。主页显示良好,但任何带有slug的页面都会产生403错误。例如

http://xxxxxxxxxxx/~test/
很好

http://xxxxxxxxxxx/~test/about-us
产生403错误

我看到了,但我的应用程序文件夹及其子文件夹和文件都已拥有755的权限

我的基本Url设置为

http://xxxxxxxxxxx/~test/
我的.htaccess如下所示:

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt|static)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
http://xxxxxxxxxx/~test/about-us/consultancy
编辑:如果有区别,我应该说我修改了core router.php(我知道最好创建我自己的my_router.php,但无论如何),以允许URL中使用连字符:

$segments = $this->_validate_request(str_replace('-','_',$segments));
但我试着把它改回

$segments = $this->_validate_request($segments);
这没什么区别

编辑2:

另一个更新。它使用如下URL:

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt|static)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
http://xxxxxxxxxx/~test/about-us/consultancy
只是这个不行

http://xxxxxxxxxx/~test/about-us
尽管这确实有效:


工作正常吗?不,这会产生相同的错误。codeigniter安装在哪里?在html/index.php或html/~test/index.php(其中html是web服务器的根)中,这可能是问题的根源(不是双关语)。它位于public_html(web服务器根目录)中。在实际的域名配置完成之前,托管公司说URL是当前的。
example.com/~test/index.php
是否存在同样的问题?或者这就是你所指的主页?