我最近将我的 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>
任何帮助将不胜感激。谢谢!
最佳答案
它可能会将所有内容重定向到 /index.php
因为您已将 404 错误文档路由到它:
ErrorDocument 404 /index.php
这似乎表明您的新网络主机上的 mod_rewrite 未启用。您需要联系支持人员并了解如何打开重写模块。
关于apache - Codeigniter 网站上的链接在新服务器上损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14148835/