Wednesday, June 16, 2010

Problems $_GET if using .htaccess to remove index.php

1) Use this .htaccess to fix and remove index.php

    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

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

2)edit your application/config.php
$config['uri_protocol'] = "AUTO";
to
$config['uri_protocol'] = "PATH_INFO";
3) Put to your controller
parse_str($_SERVER['QUERY_STRING'],$_GET);

3)start using $_GET or
$this->input->get('input');

p/s: original post are here

No comments:

Post a Comment