Welcome Guest, Not a member yet? Register   Sign In
mod_rewrite and/or routes
#1

[eluser]GridWave[/eluser]
Hey All,

I need a little help with something I am trying to do and I don't know where it best fits. I am leaning towards routes.

Current url:
<url>/controller/method/en/number

What I would like, if possible
<url>/<arbirtrary value>/val1-val2-val3-val4/number.html

I don't think I can do this mod_rewrite, at least based on my limited knowledge, but believe it should be possible in routes. Assuming regex?

Thank you for your time and help.
#2

[eluser]GridWave[/eluser]
In case this helps anyone, I added a route that takes care of this and quite easily:

$route['<arbirtrary value>/([-\w]+)/(\w+)'] = 'controller/method/$2';
#3

[eluser]Zeeshan Rasool[/eluser]
You can also define a generic rule, in which first segment can be some thing unknown and you can redirect it ur function.

$route['(.*)/directory/([0-9\-]+)/([0-9\-]+)/([1-3]+)/([a-z0-9\-]+)/([0-9]+)'] = 'site/function/$2/$3/$4/$5/$6';




Theme © iAndrew 2016 - Forum software by © MyBB