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

时间:2013-01-03 23:15:36

标签: 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>

非常感谢任何帮助。谢谢!

1 个答案:

答案 0 :(得分:5)

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

ErrorDocument 404 /index.php

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