Front-end, Back-end and htaccess |
[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?
[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.
[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.
[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.
[eluser]Yash[/eluser]
you can use ../../ to load files using view in your case Code: $this->load->view('../../application/admin')
[eluser]missionsix[/eluser]
I think you need something like this: .htaccess: Code: RewriteEngine On
|
Welcome Guest, Not a member yet? Register Sign In |