dongpu9481 2015-02-26 02:57
浏览 37

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

I have deployed a website that uses CodeIgniter (http://www.myexample.com/) in the main public_html folder. In order to remove index.php from URL this has the following .htaccess:

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

Now, I've created a sub-domain where I've deployed the same website in order to have a development environment (http://dev01.myexample.com/). I’ve copied the whole website in the folder public_html/dev01. However, when I try to go to the website I'm getting an Internal Server Error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@dev01.myexample.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I know this is related to the .htaccess settings. However I'm not able to determine why this error is happening.

So far I've tried erasing .htaccess in both folders, or copying the .htaccess in both website folders. And also tried the following in the subdomain .htaccess file using relative path:

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

Does anyone know what could be the issue?

  • 写回答

2条回答 默认 最新

  • duannengling4705 2015-02-26 04:49
    关注

    point your sub domain to dev01 directory through cpanel and use the same htaccess as your live project

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

    if you have put above htaccess code in dev01 directory it look for dev01 directory inside dev01 use this

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

报告相同问题?

悬赏问题

  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗