codeigniter htaccess for multiple applications |
[eluser]cloud2681[/eluser]
Hi all I currently have an issue with multiple applications method. I have split my website into 2 applications my site structure is Code: application/ i have done a clean install with admin simply a copy of index with the application pointed to application/admin all i want to do is change the admin.php to just admin/controller/function but no matter what i try i can not do a mod_rewrite for it, i had it working perfect for index so i just changed the names to admin and it didnt work My question is is there a way to do this using Mod_rewrite? thank you for any replies
[eluser]sv3tli0[/eluser]
Code: application/ Just make admin folders in controller / models / view folder And perhaps you can set your index.php in a www folder (if so, you have to fix app/sys folder paths.
[eluser]cloud2681[/eluser]
I currently planning on building this project using modules the HMVC way so i ideally want this separated, so i can easily remove the admin for other projects.
[eluser]sv3tli0[/eluser]
.. CI is MVC not HMVC which is your problem.. Perhaps you may make one little "trick".. At index.php Go To: Code: $application_folder = 'application'; And make something as.... Code: if( mb_strtolower( mb_substr( $_SERVER["REQUEST_URI"], 1, 5, "UTF-8" ), "UTF-8" ) === "admin" ){ And 1 idea from me is to create www folder where to put your index.php and all public files .. In that case you will have to update your sys/app paths with ../ infront
[eluser]cloud2681[/eluser]
cool this looks promising ill give this a go. and there is a way to get Codeignighter to perform a HMVC architecture as i already have this working
[eluser]cloud2681[/eluser]
Dont think this will work actually because when admin is typed this will direct away from index which then cannot process this statement?
[eluser]sv3tli0[/eluser]
This is a trick to select CI Application ... How ever any routes from frontend with /admin/ will fail! /admin
[eluser]cloud2681[/eluser]
Sorry sv3tli0 im a little lost i tried your suggestion and it just showed a 404. i have got it working to with admin.php but why wont a simple mod_rewrite work on admin.php just like it does for the index.php
[eluser]sv3tli0[/eluser]
Ok.. with little search here is working way : http://philsturgeon.co.uk/blog/2009/07/C...odeIgniter
[eluser]cloud2681[/eluser]
doesn't tell me how to do it, although i just solved a work around incase anyone else has this issue this is what i did. my file structure Code: application/ this worked for me now i have clean URLS for admin and both applications are nicely divided |
Welcome Guest, Not a member yet? Register Sign In |