URL problem in codeigniter 3

0

I have an application on a server:

http://192.168.0.200/aplicacao

When I authenticate to access this error appears:

  

The requested URL / application / auth / login was not found on this server.

I searched and saw that it could be in the .htaccess file. I changed it but it's still the same:

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.html index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /aplicacao/index.php/$1 [L,QSA]

The same error mentioned above occurs.

When I had the application in localhost , it worked without problems and I set up the files from codeigniter to friendly url.

    
asked by anonymous 11.06.2018 / 14:40

1 answer

0

It can be the same .htaccess and related to server URL overriding. To use a friendly URL (excluding the index.php from the URL) you need to configure the .htaccess of the project root as follows:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

Next you need to check if URL overwrite is active on the server. you should enable it as follows:

  • Open the web server httpd.conf;
  • Uncomment the line LoadModule rewrite_module modules/mod_rewrite.so by removing the # of the beginning of the line (or other comment character that exists);
  • Restart the server.
  • 14.06.2018 / 13:52