Welcome Guest, Not a member yet? Register   Sign In
Url Routing (Wildcard) Problem
#1

[eluser]egguzel[/eluser]
Hi everybody

I have a very basic problem. Even the simplest url routing function does not work in my code.

For example when my url is http://sitename/journals, I could not go to the http://sitename/blogs page.

Can someone help me?

Thank you

routes.php file =>
$route['default_controller'] = 'index';
$route['404_override'] = '';
$route['journals'] = 'blogs';

.htaccess file =>
Deny from all
#2

[eluser]Carmichael[/eluser]
Does http://sitename/index.php/journals work?
#3

[eluser]CroNiX[/eluser]
Yes, if you have a "blogs" controller and using a route of "journals" to be able to access it, you will still be able to access it via "blogs". Routes just provide an additional alternative method of routing requests, but don't replace the original.

However, it doesn't matter as long as your links are consistent and always use "journals" and never "blogs". No one will know and either will search engines, which rely on links to find content.

If it's a problem for you for some reason, you can always do a check of what segment(1) is from within your "blogs" controller and if it's "blogs" instead of "journals", issue a 404 or something. Although that is really unnecessary.
#4

[eluser]egguzel[/eluser]
Thanks Carmichael and CroNix.

http://sitename/index.php/journals page does not work. I get 404 Not Found error.

http://sitename/index.php/blogs page works, it is OK.


I'm stuck here.

How can I check of what segment(1).

Thanks again
#5

[eluser]InsiteFX[/eluser]
Segment 1 is the controller.

controller/method

So what your url's are showing is a journals and blogs controller which will always go to there index method




Theme © iAndrew 2016 - Forum software by © MyBB