Allow leading underscore in URL w/o method name |
[eluser]rickyracoon[/eluser]
I am working on an app with a controller named User. I'd like to be able to call the index method of this controller without actually having index appear in the URL. So I construct the URL like this: http://myurl.com/user/username/profile.html Then in my controller I add a _remap to manually send the correct param to the index method: Code: function _remap($method) This works fine except that usernames can start with underscore - so when you try to get to the profile page for a username such as "_monkeyman", codeigniter sends a 404 before it even reaches the _remap of the controller. Here is an example of a URL that fails: http://myurl.com/user/_monkeyman/profile.html Of course, adding index works: http://myurl.com/user/index/_monkeyman/profile.html ...but I want to keep the URL clean. I know Codeigniter thinks I'm trying to access a reserved method because of the leading underscore, any ideas to workaround this? I was thinking routes perhaps but would I be able to keep the URL in the same format? Thanks in advance |
Messages In This Thread |
Allow leading underscore in URL w/o method name - by El Forum - 01-14-2010, 11:00 AM
Allow leading underscore in URL w/o method name - by El Forum - 01-14-2010, 12:54 PM
Allow leading underscore in URL w/o method name - by El Forum - 01-14-2010, 10:03 PM
|