4

Im having some trouble removing the index.php thing on my CI install, the current .htaccess im using is as follows:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

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

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
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>
ErrorDocument 404 /index.php
</IfModule> 

My CI install is back from the public_html directory and i have changed the config to

$config['index_page'] = "";

So my CI looks like the following

/core-1.7.3
/public_html/index.php

When i type the url i get the 404, but when i put index.php in front of it, it works fine :S

Im confused

4 Answers 4

1

Hi I ve installed that 1.7.3 and this .htaccess worked with this URL-

/CodeIgniter_1.7.3/public_html/welcome

.htaccess->

RewriteEngine On

RewriteCond $1 !^(index\.php|resources|robots\.txt)

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
Sign up to request clarification or add additional context in comments.

Comments

0

Work through Avisek Chakraborty's comment and make sure you've done them all, but it sounds to me like you don't have mod_rewrite installed correctly. Make sure it is by using the following test: http://www.wallpaperama.com/forums/how-to-test-check-if-mod-rewrite-is-enabled-t40.html

It is written for windows but you should get the idea.

If it doesn't work then install mod_rewrite and try again.

Comments

0

Also try to change this:

$config['uri_protocol'] = “REQUEST_URI” 

2 Comments

Now its just giving 404 for every page.
Can u check these things- 1. If your installation is not in the server root you will need to amend the RewriteBase line from “RewriteBase /” to “RewriteBase /folder/” 2. Make sure your apache uses the mod_rewrite module 3. Make sure apache is configured to accept needed .htaccess directives [reference- codeigniter.com/wiki/mod_rewrite/]
0

You need the FollowSymLinks directive for .htaccess rewrites ...

Options Indexes FollowSymLinks

   <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
   </IfModule>

The Options directive is in The Apache Docs

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.