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 post
Share on other sites

i tailed my apache error log and i got this

 

 

[Thu May 26 10:40:29 2011] [notice] jrApache[65189: 59606]  Couldn't initialize from remote server, JRun server(s) probably down.

 

i get this for every project inside of my htdocs

Link to post
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 post
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 post
Share on other sites

In your httpd.conf, Line 461 and 462

# AccessFileName .htaccess

AccessFileName htaccess.txt

 

Unquote the first line and delete the second and then restart Apache.

Link to post
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 post
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 post
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 post
Share on other sites

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.