.htaccess file and url. how to make in shorter? |
[eluser]linderox[/eluser]
i have a function1 in the controller1 www.mydomain.com/controller1/function1/parametr1, but I want to save such construction of the controller file, but I want to reach this url by shorter line (without function1 name) www.mydomain.com/controller1/parametr1 here is my standart .htaccess file Code: addDefaultCharset utf8
[eluser]Dam1an[/eluser]
You only have 1 function in each of your controllers? or do you want all but one of the functions per controller to be routed as normal, and just the one which doesn't?
[eluser]linderox[/eluser]
I want to change just one function. There are lot's of function in the controller
[eluser]linderox[/eluser]
I look into URI Routing and understand that it could redirect to the existing page, but I want to create some virtual link for example mydomain.com/people/index/nick I want to replace with mydomain.com/people/nick
[eluser]n0xie[/eluser]
[quote author="linderox" date="1244133511"]I look into URI Routing and understand that it could redirect to the existing page, but I want to create some virtual link for example mydomain.com/people/index/nick I want to replace with mydomain.com/people/nick[/quote] Isn't this exactly what the URI routing does?
[eluser]Dam1an[/eluser]
[quote author="n0xie" date="1244133838"][quote author="linderox" date="1244133511"]I look into URI Routing and understand that it could redirect to the existing page, but I want to create some virtual link for example mydomain.com/people/index/nick I want to replace with mydomain.com/people/nick[/quote] Isn't this exactly what the URI routing does?[/quote] Yeah, so a route like this should work Code: $route['people/(:any)'] = 'people/index/$1'; If you have any other functions with can be called in the url, such as /people/add, make sure someone can't have 'add' as a name
[eluser]linderox[/eluser]
thank you it works! and what about link to the files? I want to hide link to some *.jpg file how to do this? I have some path to the image file for example mydomain.com/images_files/img_2323.jpg, and I want to see the file on a page on a mydomain.com/jpg/111111/ |
Welcome Guest, Not a member yet? Register Sign In |