Welcome Guest, Not a member yet? Register   Sign In
default controller problem
#1

[eluser]sigma[/eluser]
Hy together

Isn't it possible to set a controller in a subdirectory (controllers/home/overview.php) as a default controller?
When I change the default_controller entry in routes.php to $route['default_controller'] = "home/overview"; a 404-Error appears.

But if I call the controller via /index.php/home/overview everything works

Can anybody help me please?

Greets
sigma
#2

[eluser]Thoer[/eluser]
Hey sigma!

I won't be able to help you but I know this question has been discussed on this forum. Try searching for it a bit.
#3

[eluser]gtech[/eluser]
[url="http://ellislab.com/forums/viewthread/63125/"]dug out this link for you[/url], this is a fix to the 'problem?', but it may be easier if you just put the default controller in the application root directory. I haven't used it yet but people seem to rate [url="http://ellislab.com/forums/viewthread/65749/"]matchbox[/url] (the new name for modular separation), might be good for you to investigate.
#4

[eluser]sigma[/eluser]
Thank you

I solved the problem with a redirect...
No the next problem:
how to remove the index.php in the redirected-URL?
I Added following htaccess-File:
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

It works, but when I redirect there is a index.php in the url again... how can I remove this one?
#5

[eluser]gtech[/eluser]
Hello again

You need to set the index_page in your system\application\config.php to '' instead of 'index.php'

Code:
//$config['index_page'] = "index.php";
$config['index_page'] = "";

check out [url="http://codeigniter.com/wiki/mod_rewrite/"]mod rewrite[/url] for the full instructions.

site_url() is used when redirecting and doing a form_open and this is retrieved using the base_url and index_page from the config.
#6

[eluser]sigma[/eluser]
Thank you
now it works...

Just a little problem:
When you enter example.com/index.php/home/overview the browser changes it to example.com/index.php/home/home/home/home/home/home/home/home/.../home/overview

any idea?




Theme © iAndrew 2016 - Forum software by © MyBB