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 GiftFlow.org and it works great.
web root /var/www/vhosts/giftflow.org/httpdocs
From my hosting control panel, I created a favorece.giftflow.org subdomain and cloned everything into it.
web root /var/www/vhosts/favorece.giftflow.org/httpdocs
When I call favorece.giftflow.org
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
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.
source to share
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 http://mango.penguintechno.com
source to share