Welcome Guest, Not a member yet? Register   Sign In
Understanding CI URL Structure
#8

[eluser]Krumpet[/eluser]
Just wanted to post a follow up after I figured this out in hopes that it will help others.

The .htaccess file I ended up using was created as follows:

Code:
RewriteEngine on
RewriteBase /~[USERNAME]/CI/
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L]

The important thing to understand here is I am working on a MacBook. As I am using the generic MacBook setup, my local server is located here:

Code:
User/[USERNAME]/Sites/

while the URL structure is:

Code:
http://localhost/~[USERNAME]/[CODEIGNITER FOLDERNAME]/

Furthermore, I have many applications being developed locally so inside my Sites folder, I have a dedicated folder for every application. Let's say that foldername is 'CI' for this example.

If you want to use the .htaccess code above, you will need to replace [USERNAME] with your MacBook username. You will also need to replace CI with your Codeigniter foldername.

I have only tested this locally, but I'm pretty confident it will work after I update the RewriteBase (I won't have my application in a subfolder remotely). With this setup, all I have to do when I move this application to a remote server is update the RewriteBase.

I hope this is helpful to someone. Thanks to everyone for their insight and a special thank you to SOFTKUBE for this helpful post


Messages In This Thread
Understanding CI URL Structure - by El Forum - 05-10-2011, 03:44 PM
Understanding CI URL Structure - by El Forum - 05-10-2011, 03:56 PM
Understanding CI URL Structure - by El Forum - 05-10-2011, 04:06 PM
Understanding CI URL Structure - by El Forum - 05-10-2011, 04:08 PM
Understanding CI URL Structure - by El Forum - 05-10-2011, 04:10 PM
Understanding CI URL Structure - by El Forum - 05-10-2011, 04:28 PM
Understanding CI URL Structure - by El Forum - 05-10-2011, 04:46 PM
Understanding CI URL Structure - by El Forum - 05-12-2011, 03:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB