Welcome Guest, Not a member yet? Register   Sign In
Routes
#1

[eluser]bugboy[/eluser]
Hello All i have a question about routes.

I have read the documentation about routes but still don't fully understand how it works.

When would i use it?

How does it work.

Dose the url change like a rediect or does it stay the same?

Can it work with bookmarking or will it break?

I know this porb seem stupid but i'm really confused but it all.

Cheers
#2

[eluser]xwero[/eluser]
Routes are meant to change the standard behavior of the urls. For example you can link to a controller without adding the index segment but once you add other segments you have to add the index segment. If you don't want that to happen at all you could add this route
Code:
$route['(.+?)/index(.*)'] = '$1$2';

The url changes for your users but you can still access the standard url if you want. It is a way to make your urls more understandable.
#3

[eluser]bugboy[/eluser]
Ok so if i have a url like this

ww.mysite.com/blog/posts/hello_world

it could actually be

www.mysite.com/blog/display_posts/hello_world

For example

so the user would see the first but the syetm would remap it to the second?
#4

[eluser]xwero[/eluser]
yes that is the idea
#5

[eluser]bugboy[/eluser]
Sweet seeems powerful

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB