Jump to content

CodeIgniter Application Management and HTAccess


ShoeLace1291

Recommended Posts

So I've been building a large codeigniter application.  I recently decided to split it up into two different applications on the same installation.  I have my main application which will be accessed by regular members and guests, and then the admin application.  I've set it up so the main site is accessed through the main.php file... just a duplication of the original index.php file but with the application folder modified to applications/main.  There's also the admin.php file which is the same as main.php but the application folder is set to applications/admin. 

 

My problem is that I want to remove the index files from the url, but I want admin.php to appear as admin/ in the admin application urls.  I'm guessing there's a way to do this with HTAcess to change site.com/admin.php/controller to site.com/admin/controller without changing anything in the url of the main application... Only thing is I don't know how to do it.  :D  Can anyone point me in the direction I need to be in, or better yet, post any codes that might help?

RewriteEngine On
RewirteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

 

This will pass anything that's not an actual file to index.php. So if you request /admin/controller it will be passed like this to index.php. It's possible you'll have to change the uri_protocol in your config.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.