Forum Moderators: phranque
RewriteRule ^(.*)$ index.php/$1 [PT,L]
This is decent so far, but I want to remove a piece of a url in my content controller, so things go from...to...
site.com/content/index/chevrolette/corvette
site.com/content/chevrolette/corvette
Essentially, only in content/ do I want the index/ removed from the URL. Can anyone help me with this if its possible?
Realize that the code you posted does not change the URLs. All it does is take an incoming client request for the "friendly" URLs --and actually, for *all* URLs-- and internally rewrite that to your index.php script. The URL itself is set/defined by the link that appears on your pages, and cannot be changed by any server-side code.
So you need to modify your "controller."
Also, be aware that having done so, your controller will also need to be modified to re-inject "/index" into the 'path' wherever and whenever it is required. You'll either need to re-inject it in *all* cases, or you'll need to go check the database twice -- once with "/index" in the path, and once without. If the database returns a valid entry in both cases, then you have an irresolvable naming conflict, and will have to just 'pick one'.
Jim