Moving a CodeIgniter installation to a subdomain raises a 500 Internal Server Error

On my new subdomain, the homepage is working fine, but everything else is throwing a 500 Internal Server Error. I'm sure this is the problem .htaccess

. I have a CodeIgniter based web application at and it works great.

web root /var/www/vhosts/

From my hosting control panel, I created a subdomain and cloned everything into it.

web root /var/www/vhosts/

When I call

from my browser, the index page looks fine including CSS, but when I try to navigate to any other page, I get a 500 Internal Server Error. My Apache error log says:

The request exceeded the limit of 10 internal redirects due to a likely configuration error. Use "LimitInternalRecursion" to increase the limit if needed. Use "LogLevel debug" to get a backtrace.

Here is my base_url in CodeIgniter app / config / config.php

$config['base_url'] = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '').'://'.$_SERVER['HTTP_HOST'].str_replace('//','/',dirname($_SERVER['SCRIPT_NAME']).'/');


And my .htaccess

file in the web root favorece.giftflow


RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|user_guide|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /giftflow/index.php/$1 [L]



source to share

2 answers

You are constantly being redirected to /giftflow/index.php

. RewriteBase can help, and also additional flags for RewriteRule. Try:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [NC,L,QSA]


Also, CI usually detects automatically base_url

, so you will most likely be safe by leaving it blank. The logic you define in config.php

is probably best placed in the main index.php file.



yes his work ...!

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [NC,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]


I am trying



All Articles