繁体   English   中英

子域中的CodeIgniter内部服务器错误

[英]CodeIgniter Internal Server Error in Subdomain

我已在public_html主文件夹中部署了一个使用CodeIgniter( http://www.myexample.com/ )的网站。 为了从URL中删除index.php ,它具有以下.htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|css|app|favicon\.ico|uploads|thumbs|assets|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]

现在,我创建了一个子域,在该子域中,我部署了相同的网站,以拥有一个开发环境( http://dev01.myexample.com/ )。 我已将整个网站复制到文件夹public_html/dev01 但是,当我尝试访问网站时,出现内部服务器错误:

内部服务器错误

服务器遇到内部错误或配置错误,无法完成您的请求。

请通过webmaster@dev01.myexample.com与服务器管理员联系,以告知他们该错误发生的时间以及在该错误发生之前您执行的操作。

服务器错误日志中可能会提供有关此错误的更多信息。

此外,尝试使用ErrorDocument处理请求时遇到500内部服务器错误错误。

我知道这与.htaccess设置有关。 但是,我无法确定为什么会发生此错误。

到目前为止,我已经试过擦除.htaccess在这两个文件夹,或复制.htaccess在这两个网站上的文件夹。 并且还使用相对路径在子域.htaccess文件中尝试了以下操作:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|css|app|favicon\.ico|uploads|thumbs|assets|robots\.txt)***
RewriteRule ^(.*)$ dev01/index.php?/$1 [L]

有谁知道可能是什么问题?

通过cpanel将您的子域指向dev01目录,并使用与您的实时项目相同的htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|css|app|favicon\.ico|uploads|thumbs|assets|robots\.txt)***
RewriteRule ^(.*)$ dev01/index.php?/$1 [L]

如果您已将hta​​ccess代码放在dev01目录中,则在dev01中查找dev01目录,请使用此命令

RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|css|app|favicon\.ico|uploads|thumbs|assets|robots\.txt)***
RewriteRule ^(.*)$ index.php?/$1 [L]

尝试这个

RewriteEngine On
RewriteBase /your_folder_or_project_nmae
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM