CodeIgniter Forums

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

El Forum

[eluser]sohei[/eluser]
Hi guys,
I want to remove the "index.php/" from my url. But when I apply the user guide method (http://ellislab.com/codeigniter/user-gui.../urls.html) with the .htaccess, it don't work.
I get an "Internal Server Error".

Can anyone help me?

Thanks

El Forum

[eluser]russ_kern[/eluser]
Here is my Basic htaccess file:

Code:
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]




It works well for me.

El Forum

[eluser]sohei[/eluser]
Shit, it don't work for me Sad.
Maybe I have to change anything on my local server? I don't see what Sad

El Forum

[eluser]LuckyFella73[/eluser]
in config.php

did you set:
Code:
$config['index_page'] = "";

And did you try all possible settings in the line:
Code:
$config['uri_protocol']    = "AUTO";

Is your site running in a subfolder?

El Forum

[eluser]mlinuxgada[/eluser]
You can try this:
Code:
RewriteRule ^(.*)$ /index.php?/$1 [L]
And if this err is on your local server, check if mod_rewrite is enabled.

El Forum

[eluser]atebit[/eluser]
You also need to ensure that your local webserver is configured properly. I am running apache on OS X and had several issues getting this to work. What are you trying to run it on?

El Forum

[eluser]sohei[/eluser]
Thanks everybody but it's still not working :|

Apache is running with WAMP on win7.
When I active the rewrite_module, I have no more Internal Server Error. Nice! But all my url redirect me to the localhost source folder..

Mmmhhh i'm getting closer... Big Grin

El Forum

[eluser]LuckyFella73[/eluser]
Maybe try this one:
Code:
// .htaccess
<IfModule mod_rewrite.c>
    # Turn on the Rewrite Engine
    RewriteEngine On
    
    # If the file or directory exists, show it
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+) - [PT,L]
    
    # Blank queries get sent to the index
    RewriteRule ^$ index.php [L]
    
    # All other queries get sent to the index as index.php/whatever
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

And set
Code:
// config.php
$config['index_page'] = "";
$config['uri_protocol']    = "AUTO";

Hope that helps ..

El Forum

[eluser]sohei[/eluser]
Yup,

It's ok, the problem came from my local server.

Thanks all