URL problem in codeigniter 3

Asked

Viewed 183 times

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 can be in the file .htaccess. 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]

Same error occurs as above.

When I had the application on localhost, worked smoothly and I set up the files from codeigniter for friendly url.

  • If you have changed the route of your URL make sure that whoever is calling this authentication of yours has the route you set in Routes.php or the normal URL.

1 answer

0

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

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

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

  1. Open the httpd.conf file from the web server;
  2. Uncomment the line LoadModule rewrite_module modules/mod_rewrite.so removing the # line start (or other comment character that exists);
  3. Restart the server.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.