Welcome Guest, Not a member yet? Register   Sign In
default_controller not working or misunderstood
#1

[eluser]logan999999[/eluser]
Hi everybody,
I have to change a website but I am really new in CI.
I have created a page that I can get at http://www.website.info/fr/pricelist/listeBooks
This page should the start/default page of the site http://www.website.info/
But I can't make it work

Can someone help me. Thanks in advance

I changed routes.php like this

$route['fr'] = "pricelist/listeBooks";
$route['^fr/(.+)$'] = "$1";
$route['default_controller'] = "pricelist/listeBooks";
$route['scaffolding_trigger'] = "";

.htaccess file is like this
SetEnv PHP_VER 5
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

and config.php:
$config['base_url'] = "http://www.website.info/";
$config['index_page'] = "";
#2

[eluser]Maglok[/eluser]
The only thing I can think of right now is that the default_controller is a controller not a controller/method. Try 'pricelist' then put a redirect to pricelist/listeBooks I guess. Smile
#3

[eluser]logan999999[/eluser]
Thank you for your help
CAn you please explain how to redirect
#4

[eluser]Maglok[/eluser]
There is a function in CI that lets you redirect within CI.

Code:
redirect('controller/method')

Note: This should work as a workaround, though I can't imagine there isn't an easier way somewhere.
#5

[eluser]logan999999[/eluser]
Thank you for your help It is OK now
I just created a new default controller that redirects to desired method




Theme © iAndrew 2016 - Forum software by © MyBB