在新服务器上打破的codeigniter网站上的链接

mad*_*eye 2 apache .htaccess codeigniter

我最近将我的codeigniter网站切换到了新的虚拟主机,现在网站上的所有链接都被破坏了.每次我点击其中一个网站时,只会重定向到index.php.一切都在老服务器上工作没有任何问题.我不太了解服务器,问题是它是共享主机,我没有访问/ etc/apache2目录中的conf文件.

我的.htaccess文件是

<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /

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

</IfModule>

<IfModule !mod_rewrite.c>

    # Without mod_rewrite, route 404's to the front controller
    ErrorDocument 404 /index.php

</IfModule>
Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感谢.谢谢!

Jon*_*Lin 5

它可能会重定向所有内容,/index.php因为您已将404错误文档路由到它:

ErrorDocument 404 /index.php
Run Code Online (Sandbox Code Playgroud)

这似乎表明你的新webhost上没有打开 mod_rewrite .您需要联系支持部门,了解有关启用重写模块的信息.