php - codeiginiter always shows 404 error ubuntu 14.04 -
i done project using codeiginiter in windows(xampp), changed os ubuntu 14.04 , have installed lamp , lamp works fine.
i copied project files /var/www/html , changed configurations ububtu
$config['base_url'] = 'http://localhost/lankaproperty/'; $config['index_page'] = 'index.php';
routes
$route['default_controller'] = 'welcome'; $route['404_override'] = 'home/error_404'; $route['500_override'] = 'home/error_500'; $route['translate_uri_dashes'] = false;
.htaccess
rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule .* index.php?/$0 [pt,l]
i have changed file permissions 755..
when try default controller http://localhost/lankaproperty/ works fine..
but none of other controller working
http://localhost/lankaproperty/home
http://localhost/lankaproperty/index.php?/home
i error.
` 404 page not found
the page requested not found. ` can me fix issue tnx..
etc/apache2/apache2.conf
# sets default security model of apache2 httpd server. # not allow access root filesystem outside of /usr/share , /var/www. # former used web applications packaged in debian, # latter may used local directories served web server. if # system serving content sub-directory in /srv must allow # access here, or in related virtual host. <directory /> options followsymlinks allowoverride require denied </directory> <directory /usr/share> allowoverride require granted </directory> <directory /var/www/html> options indexes followsymlinks allowoverride require granted </directory>
sites-enabled/000-default.conf
<virtualhost *:80> # servername directive sets request scheme, hostname , port # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used last resort host regardless. # however, must set further virtual host explicitly. #servername www.example.com serveradmin webmaster@localhost documentroot /var/www/html # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined # configuration files conf-available/, # enabled or disabled @ global level, possible # include line 1 particular virtual host. example # following line enables cgi configuration host # after has been globally disabled "a2disconf". #include conf-available/serve-cgi-bin.conf </virtualhost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
sites-avalible/000-default.conf
<virtualhost *:80> # servername directive sets request scheme, hostname , port # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used last resort host regardless. # however, must set further virtual host explicitly. #servername www.example.com serveradmin webmaster@localhost documentroot /var/www/html # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined # configuration files conf-available/, # enabled or disabled @ global level, possible # include line 1 particular virtual host. example # following line enables cgi configuration host # after has been globally disabled "a2disconf". #include conf-available/serve-cgi-bin.conf </virtualhost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
replace value these 2 section in config file.
$config['base_url'] = 'http://localhost/lankaproperty/'; $config['index_page'] = 'index.php';
to
$config['base_url'] = ''; $config['index_page'] = '';
hope usefull u.
Comments
Post a Comment