Welcome Guest, Not a member yet? Register   Sign In
question concerning url parameters
#1

[eluser]plainas[/eluser]
Ok... so I want to have an url structure like this:

http://example.com/myapp/food/list/fruit

That's fine, but let's say that I got so much fruit that i need to use pagination.
I can use for example CI pagination class and work out a url like this:

http://example.com/myapp/food/list/fruit/page/3

In this case the third page would show.
One might think that there is no problem with this. But there is a problem, an url like the last one, with the meaningful content in the end, is a lot more search engine friendly.

I don't mind having links like:
http://example.com/myapp/food/list/fruit/page/2
http://example.com/myapp/food/list/fruit/page/3
http://example.com/myapp/food/list/fruit/page/4
...

but there's a quite good SEO advantage in using a simpler url for the first page:
http://example.com/myapp/food/list/fruit
instead of something like this:
http://example.com/myapp/food/list/fruit/page/1

Problem is:
if a controller function definition as the page number as a parameter, then it will throw an error if it's not present.

How can one make an url parameter optional?


Messages In This Thread
question concerning url parameters - by El Forum - 08-12-2008, 04:45 PM
question concerning url parameters - by El Forum - 08-12-2008, 06:47 PM
question concerning url parameters - by El Forum - 08-12-2008, 07:18 PM
question concerning url parameters - by El Forum - 08-13-2008, 07:05 AM
question concerning url parameters - by El Forum - 08-13-2008, 01:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB