Welcome Guest, Not a member yet? Register   Sign In
Remove Module Name from URL
#2

[eluser]matt.asbury[/eluser]
Hi Andrew

Do you mean you would like to change the URL from http://www.site.com/frontend/post/view/1 to http://www.site.com/post/view/1 but still hit the frontend Controller? I'm not 100% sure, but I don't think this is easily possible. The trouble you will have is getting codeigniter to differentiate between a function call (/post/ in this example) and a class.

I suppose it might be possible to create a custom Controller (MY_Controller) which checks whether a class exists (class_exists function) using the first segment of the URL. If it does, go to that class and if not go to the frontend class and use the first segment of the URL as the function.

I don't think it would be possible to use a .htaccess file to achieve this as you would not be able to use a RewriteRule to say what a class is and what a function is.


Messages In This Thread
Remove Module Name from URL - by El Forum - 11-12-2010, 04:09 PM
Remove Module Name from URL - by El Forum - 11-12-2010, 05:45 PM
Remove Module Name from URL - by El Forum - 11-12-2010, 05:48 PM
Remove Module Name from URL - by El Forum - 11-12-2010, 08:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB