[eluser]ywftdg[/eluser]
Ok, I have since fixed this, it all came very fast, hahah. But I have a few questions on best methods.
So now, in order for this to work, I have my urls going: domain.com/projects/1/name
Is this url still nice, ok, clean if it has the number in the middle like that? Also, if I have names with spaces, and I get the formating thing, is this garbage too, should be fixed. I think wordpress uses like - to make spaces yeah?
Let me know what you guys think...
Ignore posts above, all working and fine. In case anyone in the future is searching this forum for routes, url spaces, I fixed my problems above doing:
Added my remapping routes in the 'application/config/routes.php' file to the following:
Code:
$route['projects/:num/:any'] = "commonwealth/projects_details/";
$route['projects'] = "commonwealth/projects/";
The first one still included my project id, but then adds the name (or anything you want) at the end of my url. I then needed to remove any spaces that might occur at the end of my urls (project names sometimes have spaces).
Code:
<? $newTitle = str_replace(" ","-", $row->pTitle);?>
The second route removed my main controller as well (commonwealth) from the url.
Then when making links in my views, i just call the /projects area. I also removed the spaces. Maybe this will help another beginner somewhere in the future..
I did the above because I wanted a clean url structure to my clients portfolio. So "domain.com/projects/1/sears_tower " would be an example.