0

Im having trouble trying to make routes work on the production system(nginx). It works on localhost which is running apache.

File structure

/var/www/example.com
   --application
   --system
adm
   --application
   --system
   --controller
       --user
       --example
   --model
        --users_model
    --views
        --admin/
              --login
              --signup_form
        --example

I keep getting 404 error when trying to access the controller from adm folder. My routes

$route['default_controller'] = 'user';
$route['404_override'] = '';

/*admin*/
$route['admin'] = 'user/index';
$route['admin/signup'] = 'user/signup';
$route['admin/create_member'] = 'user/create_member';
$route['admin/login'] = 'user/index';
$route['admin/logout'] = 'user/logout';
$route['admin/login/validate_credentials'] = 'user/validate_credentials';

user controller view is displayed just the static content and everything else gives 404.

/var/www/example.com/adm/application/config/config.php

base_url = http://example.com/adm
uri_protocol = AUTO

Any help would be greatly appreciated, TIA.

Rohit Gaikwad
  • 817
  • 2
  • 8
  • 24
user1691915
  • 63
  • 2
  • 11
  • `RewriteEngine on RewriteBase /adm/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] ` htaccess file from **adm** dir – user1691915 Sep 10 '15 at 09:41
  • Do you have [these](http://wiki.nginx.org/Codeigniter) settings? – Tpojka Sep 10 '15 at 11:39
  • Yup. Its not working, still showing 404 not found. I'm actually unable to access the controller from the URL as well, like [example.com/adm/user/index] after removing all the route variables except for the default route. – user1691915 Sep 10 '15 at 17:28

1 Answers1

0

You have to add index.php after your project folder like:

www.site.com/project/index.php/user/signup

If you want to access your site without index.php then see this post CodeIgniter removing index.php from url

Community
  • 1
  • 1
Chintan7027
  • 7,115
  • 8
  • 36
  • 50