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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.