将CodeIgniter项目本地传输到服务器,管理面板不工作

问题描述 投票:-1回答:2

我在我的本地机器上创建了CodeIgniter项目(运行完美),然后我上传到带有数据库的服务器,但我面临的问题是在打开管理面板时没有发现错误。

我更改了配置文件(基本URL),database.php(用于数据库连接)。但我不知道在.htaccess文件中要改变什么,我采用了默认的CodeIgniter .htaccess文件,但它显示未找到错误。 htaccess文件:

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /crescent_test/ad_crescent/
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php?/$1 [L]
 </IfModule>
 <IfModule !mod_rewrite.c>
   ErrorDocument 404 /index.php
 </IfModule>
php .htaccess codeigniter
2个回答
0
投票

试试这个更新的代码。

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond $1 !^(index\.php|resources|robots\.txt)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L,QSA] 
 </IfModule>

如果这不起作用,请访问以下链接:

Page isn't working and returns HTTP error 500 in CodeIgniter


0
投票

你可以试试这个:

添加htaccess文件YOUR_ADMIN_FLODER root

<IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /YOUR_ADMIN_FLODER_NAME/
    Options -Indexes

    RewriteCond %{REQUEST_URI} ^system.*

    RewriteRule ^(.*)$ /YOUR_ADMIN_FLODER_NAME/index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} ^application.*

    RewriteRule ^(.*)$ /YOUR_ADMIN_FLODER_NAME/index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ /YOUR_ADMIN_FLODER_NAME/index.php?/$1 [L]

</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /YOUR_ADMIN_FLODER_NAME/index.php
</IfModule>
© www.soinside.com 2019 - 2024. All rights reserved.