Jump to content

Code Igniter - Removing index.php


briangelhaus

Recommended Posts

i have a problem removing index.php. i made a simple video of my setup to help you understand faster. ive posted on other forums and no one could help me. ive followed all the instructions on CI site http://codeigniter.com/wiki/mod_rewrite/

 

 

heres the video

http://dl.dropbox.com/u/9883217/code.mov

Link to comment
https://forums.phpfreaks.com/topic/237380-code-igniter-removing-indexphp/
Share on other sites

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. 

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.

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

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

  • 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

  • 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]

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.