Welcome Guest, Not a member yet? Register   Sign In
Hiding class from url
#1

[eluser]Nial[/eluser]
I'm trying to avoid having to place my default CI controller within a url. For example, I have a default controller: welcome. The controller has two classes: index and info. When I navigation to: http://mysite.com/ the default welcome controller is called and the code in index is executed, as expected. However, where I would like to be able to navigate to http://mysite.com/info/ to trigger the info message, I get a 404 error. Instead, I must navigate to http://mysite.com/welcome/info.

What baffles me is that with another CI project, this works perfectly. I've dug around, and I'm not doing anything different with regards to .htaccess (I simply hide index.php), or routes (all I define is the default controller). I'm certain I must have done something to initiate this behaviour, but I've forgotten what!

Any suggestions?
#2

[eluser]richthegeek[/eluser]
you need to look at routes
#3

[eluser]Nial[/eluser]
I've looked at routes, as I stated in my initial post. My other CI project doesn't have any specific route settings, other than the default controller.
#4

[eluser]richthegeek[/eluser]
does it have an info controller?
#5

[eluser]Nial[/eluser]
No, the welcome controller has an info method.
#6

[eluser]xwero[/eluser]
Does your other project has a MY_router.php file? (located in the application/libraries directory)
#7

[eluser]Yash[/eluser]
did u set base_url??
#8

[eluser]insub2[/eluser]
[quote author="Nial" date="1215744979"]...routes (all I define is the default controller)...[/quote]

the only route set is the default controller like this:
Code:
$route['default_controller'] = "welcome";
is that correct?

is there anything like this?
Code:
$route['info'] = "welcome/info";




Theme © iAndrew 2016 - Forum software by © MyBB