URI |
[eluser]nuttynibbles[/eluser]
hi, i've got a profile page. what i did was do a profile controller, created a view function which retrieve info for the display of user profile. so my url will be http://domain.com/profile/view/username. i've seen other webpage whereby the url is simply http://domain.com/username. how do i go about this??
[eluser]nuttynibbles[/eluser]
will it work if i'm using a sub domain currently. it's in development stage
[eluser]nuttynibbles[/eluser]
my url is http://dev.domain.com the link i wanna route is http://dev.domain.com/profile/view/123 i did $route['user/(:num)']='profile/view/$1' but it did not work. it gave me a blank page. is there something i missed?
[eluser]Tom Schlick[/eluser]
is 123 a username? or an ID? like are you trying to route something.com/bob to something.com/profile/view/248? if so you will have to do some queries on your db to get the id of the user. try taking a look at this page... http://ellislab.com/forums/viewthread/85290/ it really helped me out doing this
[eluser]huzzi[/eluser]
This may help http://ellislab.com/forums/viewthread/60672/
[eluser]asim111[/eluser]
Try This: Code: $route['(:num)'] = "profile/view/$1"; in .htaccess Code: Options +FollowSymLinks Tested: To convert http://www.domain.com/profile/view/userid into http://www.domain.com/view/userid Code: $route['view/(:num)'] = "profile/view/$1";
[eluser]nuttynibbles[/eluser]
hi asim111, i tried yr method but to no success. here are the content in my htaccess file: Code: Options -indexes im not sure if the htaccess does affect the routing.
[eluser]nuttynibbles[/eluser]
managed to resolve the problem.. basically i got the wrong segment in profile/view. it should be $this->uri->segment(2) and not $this->uri->segment(3) |
Welcome Guest, Not a member yet? Register Sign In |