在服务器上处理codeigniter应用程序

时间:2017-08-16 05:46:55

标签: codeigniter server

我有CODEIGNITER网站在服务器上运行并成功运行,但当我移动(复制并粘贴)同一服务器上另一个文件夹中的内容时,我发现404页面未找到错误。

任何想法为什么?

1 个答案:

答案 0 :(得分:0)

enter image description here在项目文件夹中使用此htaccess而不是在应用程序文件夹

<IfModule mod_rewrite.c>
  RewriteEngine On
  # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
  #  slashes.
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.
  # Submitted by: ElliotHaughin

  ErrorDocument 404 /index.php
</IfModule>

如果你的文件夹没有像public_html / project_folder那样关注 而不是在这里改变

RewriteBase project_folder/