Welcome Guest, Not a member yet? Register   Sign In
index.php in url
#1

[eluser]Unknown[/eluser]
Hello,

can't find the answer/solution in the Manual, neither on the forum. A lot of similar problems, but not exact the same.

My files:
application/controllers/admin/admin.php
application/controllers/admin/login.php

My routes:
$route['admin'] = 'admin/admin';

Inside 'admin.php':
Code:
<?php
class Admin extends Controller {

    function Admin()
    {
        parent::Controller();    
    }
    
    function index()
    {
        redirect('admin/login', 'refresh'); // testing
    }
}
?>

My htaccess:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?$1 [L]
</IfModule>

Problem:
When I surf to http://mysite/admin i get redirected to http://mysite/index.php/admin/login . How can I remove the index.php ? It's the first time I'm using subfolders in the 'controller' folder, therefore the index.php wasn't there...

Thanks for helping!
#2

[eluser]mddd[/eluser]
Have you removed the 'index.php' in your config.php too? If you use redirect() or site_url() or similar functions, they use the 'index page' you specify in config.php. Make sure it is set to "" (empty string).
#3

[eluser]Unknown[/eluser]
There you go! That was stupid of me.. Setting the 'index_page' to an empty string solved the problem. Thanks for the help mddd!




Theme © iAndrew 2016 - Forum software by © MyBB