Welcome Guest, Not a member yet? Register   Sign In
Help and suggestions for making a short URL structure?
#1

Hi all,

I am building a new shop site and I had a plan for the url's but cannot see how to do it efficiently.

Normally I would have urls something like this:
Code:
http://www.mysite.co.uk/product/large-ceramic-teapot
http://www.mysite.co.uk/range/ceramic-teapots
http://www.mysite.co.uk/sector/restaurant-commercial-teapots

Where of course the product controller (index method) would decode the product name and show the relevant product. Same for ranges and sectors.

But I would like this time to do this:
Code:
http://www.mysite.co.uk/large-ceramic-teapot
http://www.mysite.co.uk/ceramic-teapots
http://www.mysite.co.uk/restaurant-commercial-teapots

But as far as I can tell, the only way I can do this is to have a controller for each product, sector or range, which is of course impossible (or at least inefficient).

I was wondering if there was something I could do with routes, but again, there is no way I can think of that will also work with the other 'normal' urls like

Code:
http://www.mysite.co.uk/admin/dashboard
http://www.mysite.co.uk/members/login
http://www.mysite.co.uk/checkout/basket
etc.

I also thought about customising the CI routing so that in the case of the controller 'large-ceramic-teapot' not being found, routing to a default controller that could deal with if the request is for a product, range or sector or not. However, tinkering with the CI routing is not something I am keen on trying. I am sure I will just bugger something up without realising I have until later in the project.

Does anyone have any suggestions about how I could achieve this shorter url?

I suspect the answer is that there is no way to do it, and I will have to go back to the original longer urls.

Thank you in advance for any suggestions,

Best wishes,

Paul.
Reply


Messages In This Thread
Help and suggestions for making a short URL structure? - by PaulD - 12-02-2017, 04:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB