0

I'm trying with codeigniter, I build a small web that working fine in local but when I uploaded to my free hosting (http://www.hostinger.es) then don't work. I think it is because the .htaccess and I'm reading and trying some .htaccess configurations but still don't work.

My CodeIgniter proyect is in mydomain/admin because the rest of web is not codeigniter:

Some options of my config.php

$config['base_url'] = 'http://whereis.hol.es/admin';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '.html';

And my last .htaccess, I'm try to get simple as possible to understand it.

RewriteEngine on
RewriteCond $1 !^(index\.php|images|swf|uploads|js|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

It's my first time with htaccess files, I'm reading to learn, but I can't get my web online. I don't know sure where put the .htaccess file: - / of my website - / of my codeigniter (admin) - application codeigniter folder (admin/application)

PD: When I try to load admin it redirect to my controller Login but show a 404 error: 404 Page Not Found

The page you requested was not found.

1 Answer 1

2

Use the following code in your .htaccess file

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Russell. This htaccess is not removing the index.php from url, I can load admin/index.php/login but not admin/login
Sorry, it's working ok, thanks Russell. Now I have problems to find model but could be code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.