Jump to content

Code Igniter - Removing index.php


briangelhaus

Recommended Posts

Is the mod_rewrite module being loaded in the apache configuration?  If the line is started with a hash (#), its commented out and disabled, just remove the hash and save the conf you'll have to restart apache afterwards.

 

It'll be something like LoadModule rewrite_module <mod_dir>/mod_rewrite.so

 

If that's not the problem, check the access and error logs apache makes and get back to us. 

Link to comment
Share on other sites

hrmmm...

 

Try removing the <ifmodule> argument from the first block in the .htaccess, comment out the second one.

 

Lets try to get more info try enabling Apaches access log and see if that reveals anything <link to MAMP docs>

 

Check the permissions on the .htaccess file, does Apache have sufficient permissions to read it?

 

The error you mentioned is because Apache can't connect to a jrun server (a java application server), its probably not running.  Shouldn't have anything to do with the mod_rewrite problem you're having though.

 

This is probably all something very simple and we're both overlooking it.

Link to comment
Share on other sites

i got rid of the ifmodule and just have....

    RewriteEngine On

    RewriteBase /new/

   

    RewriteCond %{REQUEST_URI} ^system.*

    RewriteRule ^(.*)$ /index.php?/$1 [L]

   

    RewriteCond %{REQUEST_URI} ^application.*

    RewriteRule ^(.*)$ /index.php?/$1 [L]

   

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php?/$1 [L]

 

in my video in the httpd.conf in the apache mamp folder i allow override for .htaccess. so that should be on

 

still no luck. it works when i upload it to my .com. but id like to test it in MAMP also. kids at my school have the same problem

Link to comment
Share on other sites

  • 3 months later...

use htaccess to remove the extension name of php <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /test_directory/cyrus/CallingCards

 

    #Removes access to the system folder by users.

    #Additionally this will allow you to create a System.php controller,

    #previously this would not have been possible.

    #'system' can be replaced if you have renamed your system folder.

    RewriteCond %{REQUEST_URI} ^system.*

    RewriteRule ^(.*)$ /index.php?/$1 [L]

 

    #Checks to see if the user is attempting to access a valid file,

    #such as an image or css document, if this isn't true it sends the

    #request to index.php

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php?/$1 [L]

 

 

</IfModule>

 

<IfModule !mod_rewrite.c>

    # If we don't have mod_rewrite installed, all 404's

    # can be sent to index.php, and everything works as normal.

    # Submitted by: ElliotHaughin

 

    ErrorDocument 404 /index.php

</IfModule>

Link to comment
Share on other sites

  • 1 month later...

Try this, as it worked for me without doing anything at all, just adding the .htaccess file to the root folder.

 

Create a file called .htaccess, paste the following code into the document and upload to your server at the root web directory.

 

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>  

 

Source: http://codeigniter.com/wiki/Dreamhost_.htaccess

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

Change $config['index_page'] = 'index.php'; to $config['index_page'] = '';

and in the .htaccess file , write the following code

RewriteEngine On

RewriteCond %{REQUEST_URI} ^/system.*

RewriteRule ^(.*)$ index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?/$1 [L]

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.