CodeIgniter Forums

Full Version: Cannot remove index.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
When I try to remove index.php
and access controller: mysite.com/admin
I keep getting Internal Server Error.

.htaccess
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /code/

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]
</IfModule>
Site config
Code:
<Directory /home/mysite.com/public_html/>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>

config
Code:
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

El Forum

[eluser]Unknown[/eluser]
bump

El Forum

[eluser]Captain_Fluffy_Pants[/eluser]
yeah mine wouldnt work either

El Forum

[eluser]Captain_Fluffy_Pants[/eluser]
put this in htaccess
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

El Forum

[eluser]Unknown[/eluser]
here code for u! That is working with me!

<IfModule mod_rewrite.c>

Options +FollowSymLinks
RewriteEngine on

# NOTICE: If you get a 404 play with combinations of the following commented out lines
#AllowOverride All
#RewriteBase /yourbase

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

# Send request via index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

</IfModule>

Ps: write this code into file .htaccess within index.php folder.

El Forum

[eluser]solid9[/eluser]
Have you checked your error log file?