Codeigniter is working fine on local server but not on web server.
I used XAMPP
for the development on local.
I am using Parallels Plesk Panel 11.0.9 for Microsoft Windows.
404 error page of codeigniter is not loading. Url is loadind 404 error page of the server. I have removed all .htacces
rewrite rules of root directory and included index.php
. Still it isn’t working.
Searched alot but couldn’t find right solution
Directory for codeigniter folders(site, application, system)
is
mysite/httpdocs/demo/test/
Base url in mysite/httpdocs/demo/test/application/config/config.php
$config['base_url'] = 'http://mysite/httpdocs/demo/test/site/';
In mysite/httpdocs/demo/test/application/.htaccess
Deny from all
Envoirment set in index.php (mysite/httpdocs/demo/test/site/index.php)
switch (dirname(__FILE__)) {
case 'http://mysite/httpdocs/demo/test/site':
define('ENVIRONMENT', 'development');
break;
default:
define('ENVIRONMENT', 'production');
break;
}
$system_path = '../system';
$application_folder = '../application';
In mysite/httpdocs/demo/test/site/.htaccess
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
In mysite/httpdocs/demo/test/application/config/routes.php
$route['default_controller'] = "page";
$route['404_override'] = 'page';
$route['article/(:num)/(:any)'] = 'article/index/$1/$2';
I am giving url mysite/demo/test/site and
its giving 404 error page of web server not of codeigniter
Where am I wrong here?
2
Answers
I contacted my host. They said that there was a problem in php handler.
Apart from this IIS doesn't read
.htaccess
file, Instead I make a fileweb.config
and replace with.htaccess
in mysite/httpdocs/demo/test/site/Content of
web.config
file isNow the website is up and running. Thanks for the support.
I cannot comment yet, so I’ll go for an answer.
Check your project root directory if you have the
.htaccess
file and if you have access to the server, might as well check too ifmod_rewrite
is enabled (assuming you are using Apache). This might be an URL rewrite issue.EDIT 1
Ok now I see you have a
.htaccess
file in there. How about the<Directory>
directives in your httpd.conf or is this setup via<VirtualHost>
?EDIT 2
Try changing your
.htaccess
with this: