Welcome Guest, Not a member yet? Register   Sign In
Can't remove index.php from the url :/
#1

[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
#2

[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.
#3

[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
#4

[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?
#5

[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.
#6

[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?
#7

[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
#8

[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 ..
#9

[eluser]sohei[/eluser]
Yup,

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

Thanks all




Theme © iAndrew 2016 - Forum software by © MyBB