Welcome Guest, Not a member yet? Register   Sign In
SImple URL Rewrite
#1

[eluser]Unknown[/eluser]
Hello i am new in CI, i work a lot on my own MCV, but i think CI is the bets solution.And how it goes, i have lots of stuff to learn, i have a big problem with url rewrite in CI, look but no solution anywhere.CI is the best, but as i said i am a just starrting Sad Can someone help me with this two question ?

1. Is there common way to transfer GET in controller like this example

www.somesite.com/index.php/tehnicki/tekstovi?name=aboutus

GET['name'], will it be just easy to echo GET['name'] in tekstovi function?

2. I have found so many examples of URL Rewrite in CI, but not a final and good solution, i have url like this

www.somesite.com/index.php/tehnicki/tekstovi

I want to have url like this

www.somesite.com/about.html

This about is GET Variable, that is going in MySql Query, it will be no number it will be some NAME, how to do that?

And what i have to write in tehnicki controller to take that GET Variable, is there any helper in CI for MySQL Attack, or i have to write it on my own Smile
#2

[eluser]greedyman[/eluser]
1, Assuming that you have a router like this $route['(:any)'] = "user/category/$1"; the function category of user controller will get automatic $1 variable as a parameter. You don't need use $_GET.
2, All you need are remove index.php from url, create a new route $route['about'] = "user/about"; and use $config['url_suffix'] = 'html'; in config.php to create .html in your url.

Please see User Guide before!




Theme © iAndrew 2016 - Forum software by © MyBB