0

I am trying to post a form and I have the following routes inside my routes.php:

$route['install'] = 'install/index';
$route['ajax_install'] = 'install/ajax_install';
$route['success'] = 'install/success';

when i try to do the post it should call ajax_install.. however when i perform the ajax post request it shows the following enter image description here

as you can see it calls siral.marketing/install/index.php/ajax_install

why is there an index.php in it? shouldn't it be siral.marketing/install/ajax_install

here is my nginx config:

server {
    listen 80;
    listen [::]:80;

    root /var/www/smartpanel;
    index  index.php index.html index.htm;

    server_name www.siral.marketing;
    #return 301 http://siral.marketing$request_uri;

    client_max_body_size 100M;

    autoindex on;

    location / {
        try_files $uri $uri/ /index.php;
    }

    location ~* \.php$ {
         include snippets/fastcgi-php.conf;
         fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         include fastcgi_params;
    }

    location ~ /\.ht {
            deny all;
        }

    # Deny for accessing codes
    location ~ ^/(application|system|tests)/ {
            return 403;
    }

   include snippets/phpmyadmin.conf;
}

I also already have:

$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

in my config file

aherlambang
  • 14,290
  • 50
  • 150
  • 253
  • I don't think you need this in your `route` - `$route['install'] = 'install/index';` See if removing it does your deed. – sauhardnc May 29 '20 at 19:20
  • did you remove index.php with .htaccess ? see: https://codeigniter.com/userguide3/general/urls.html#removing-the-index-php-file and https://stackoverflow.com/questions/19183311/codeigniter-removing-index-php-from-url – Vickel May 29 '20 at 23:20

0 Answers0