Welcome Guest, Not a member yet? Register   Sign In
.htaccess to have clean url, without index.php ? :(...
#1

[eluser]sikko[/eluser]
Hi,

I'm trying to set up a htaccess file to redirect all my /controller/method to /index.php/controller/method

For that, i've used the code igniter htacess:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
(http://ellislab.com/codeigniter/user-guide/general/urls.html)

You know what ? it works fine on my localhost, but not online ! (my website)

It just doesn't recognize the matched expression represented by $1.

To see what the htaccess has in output, i wrote this rewriteRule:
Code:
RewriteRule ^(.*)$ toto.php?t=$1 [L]
And the toto.php file contains this simple code line:
Code:
echo 't = '.$_GET['t'].' !!!';
In other words, mywebsite.com/waza should output: t = waza !!!
But the output is:
Quote:t = toto.php !!!

I don't know if it takes the file name, or if the regex is badly delimited... or whatever....
I CAN'T understand where is the problem... i've spent my whole night on it.... but no changes... Please I'm lost !

Thank you for your help!
#2

[eluser]stormbytes[/eluser]
Funny -

I have the exact opposite problem. I'm runing Mamp on OSX and can't get *rid* of my index.php!
#3

[eluser]sikko[/eluser]
Hi,

I just solved my problem by following this tutorial:

http://codeigniter.com/wiki/mod_rewrite/

I've just made the files modification, because I can't configure my server. But it works.
I don't understand why it does work now, and didn't with the previous htaccess...

Anyway ! thank you ! bye

sikko
#4

[eluser]Paulo Carvalho [/eluser]
Make sure that in both cases online/localhost url_rewrite is ON!




Theme © iAndrew 2016 - Forum software by © MyBB