Front-end, Back-end and htaccess - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Front-end, Back-end and htaccess (/showthread.php?tid=10685) |
Front-end, Back-end and htaccess - El Forum - 08-08-2008 [eluser]Sceneshift[/eluser] I've done a fair amount of searching and I can't seem to find a solution to this problem. I have the following file structure: Code: application And of course two php files (index.php and admin.php) both located in the root. The site is working fine, but I am trying to configure my htaccess file so that anything http://www.mysite.com/admin/ will read the admin.php file and ANYTHING ELSE will read the index.php file. Can anyone help? Front-end, Back-end and htaccess - El Forum - 08-08-2008 [eluser]Yash[/eluser] Why with htaccess just simply use a controller name admin and load admin.php in index function of this controller.You're done. Front-end, Back-end and htaccess - El Forum - 08-08-2008 [eluser]Sceneshift[/eluser] I'm not sure the above would work since I'd like http://www.mysite.com/admin/ to act as the root for my 'backend' application.. for example: http://www.mysite.com/admin/controller/method/ I understand I could have a route setup so anything /admin/ automatically points to admin.php's root controller, but I'd prefer to just rewrite it. Front-end, Back-end and htaccess - El Forum - 08-08-2008 [eluser]gon[/eluser] You can store controllers into subfolders (1 level deep only). So you just have to create /controllers/admin/ and place your admin controllers there. Front-end, Back-end and htaccess - El Forum - 08-08-2008 [eluser]Yash[/eluser] you can use ../../ to load files using view in your case Code: $this->load->view('../../application/admin') Front-end, Back-end and htaccess - El Forum - 08-08-2008 [eluser]missionsix[/eluser] I think you need something like this: .htaccess: Code: RewriteEngine On Front-end, Back-end and htaccess - El Forum - 08-08-2008 [eluser]Sceneshift[/eluser] Thanks missionsix, top one! Front-end, Back-end and htaccess - El Forum - 08-08-2008 [eluser]missionsix[/eluser] Np, glad i could help. |