codeigniter 编码器错误:服务器错误500

9avjhtql  于 2023-01-15  发布在  其他
关注(0)|答案(3)|浏览(155)

我有一个应用程序是使用Codeigniter设计的,在我的本地主机上一切正常,但在现场部署后,当我试图打开http://www.wesecure.com.ng/posts/view_posts/3时,我得到了响应服务器错误500。
我已经搜索了所有通过网络,但没有解决方案似乎是工作的一些技术原因,我无法弄清楚。我将不胜感激您的支持

. htaccess.php文件系统

<IfModule mod_rewrite.c>

 # allow_override On
 # mod_rewrite is installed

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

 <IfModule mod_php5.c>
     RewriteRule ^(.*)$ index.php/$1 [L]
 </IfModule>

 <IfModule !mod_php5.c>
     RewriteRule ^(.*)$ index.php?/$1 [L]
 </IfModule>

</IfModule>

配置文件[索引页]= 'http://www.wesecure.com.ng/';配置文件[URI协议]= '自动';

wgx48brx

wgx48brx1#

首先.htaccess不是.php文件。
这是一个名为.htaccess. nothing的文件。将其设置为:

RewriteEngine on

 # enable the directives - assuming they're not enabled globally
 ExpiresActive on

 # send an Expires: header for each of these mimetypes (as defined by server)
 ExpiresByType image/png "access plus 1 month"
 ExpiresByType image/gif "access plus 1 month"
 ExpiresByType image/jpeg "access plus 1 month"

 # css may change a bit sometimes, so define shorter expiration
 ExpiresByType text/css "access plus 1 days"

RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

在配置中:

$config['base_url'] = false;
$config['uri_protocol'] = "REQUEST_URI";
7rtdyuoh

7rtdyuoh2#

您的文件应该保存为.htaccess扩展名而不是.php,只需将下面的代码行放入.htaccess文件:

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

flseospp3#

尝试到编辑你.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On
  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>

<FilesMatch "\.(pdf)$">
    Order deny,allow
    Deny from all
</FilesMatch>

相关问题