Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

533
Vistas
codeigniter 3 - remove index.php : error 404 on linux but work fine on windows

Error 404 on linux but work fine on windows. What is causing this?

I use this tutorial: http://www.tutora.fr/apprendre-codeigniter/les-controleurs

application/config/routes.php :

$route['default_controller'] = 'welcome';
$route['translate_uri_dashes']  = FALSE;
$route['login'] = 'user_authentification/user_authentification';

application/config/config.php:

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['subclass_prefix'] = 'CORE_';

Local hosting on Windows (XAMPP) works fine at url mysite.dev/login.

Live hosting on Linux produces 404 error at url mysite.pro/login.

If I add index.php (mysite.pro/index.php/login), it work fine but I would remove it.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Create .htaccess file in project root directory if other .htaccess file is not already created.

copy paste below codes into it .

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /projectname
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

You can try this link http://addictors.in/remove-index-php-from-url-in-codeigniter/

don't forget to restart your server

Hope it helps.

over 4 years ago · Santiago Trujillo Denunciar

0

Linux is case sensitive. Keep in mind in which case you wrote the directory and file name. You should write file or directory name in any file exactly same what file or directory belongs.

Please check the file/directory of user_authentification. Moreover, the first letter of controller/model should be caps (codeigniter requirements). Please check did you write controller/model name correctly.

Update

Put the following snippets on .htaccess file:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteCond $1 !^(index\.php|resources|robots\.txt)
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
over 4 years ago · Santiago Trujillo Denunciar

0

The administrator has found the error. There was an error in virtual host.
The .htaccess file was never executed.
Thank you all for your help.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda