<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule mod_rewrite.c>
return array( '_root_' => 'index', '_404_' => '404', 'sign-in' => 'signIn', 'sign-in/(:segment)' => 'signIn/$1', 'sign-out' => 'signOut', 'sign-up' => 'signUp', 'sign-up/(:segment)' => 'signUp/$1', );
array(1) { ["/a/a"]=> string(0) "" }
array(0) { }
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule mod_rewrite.c>
Harro Verton wrote on Friday 20th of May 2011:The question mark is indeed required when using fastcgi. It should NOT be there for normal Apache setups.
class Controller_Test extends Controller_Rest { public function get_list() { $this->response(array( 'foo' => Input::get('foo'), 'baz' => array( 1, 50, 219 ), 'empty' => null )); } }I call mylocalhost/test/list.json?foo=bar and it appears to work! It looks like JSON, and the 'baz' array has some values. Oh, but wait, what's up with foo? It's null! I expected it to say that foo's value is equal to "bar". I'm not sure where in the sausage factory that the GET params are chopped up and stored for Input to use, but it appears that part of the factory needs some work? The CI docs indicate that horking GET is done for our own good, but I wonder if there's a way to preserve security while allowing for fastCGI and Rest? Given how many people have failed at solving this issue, I am not optimistic that there is a .htaccess silver bullet that will make this work. The only workaround I have been able to dig up is here at Stack Overflow. Basically, do a print_r on the $_SERVER and find out where those url parameters are hiding, then do something with them. EDIT: url formatting
Evan Tishuk wrote on Wednesday 6th of July 2011:The only workaround I have been able to dig up is here at Stack Overflow. Basically, do a print_r on the $_SERVER and find out where those url parameters are hiding, then do something with them.
public function get_list() { [b]parse_str(substr(strrchr($_SERVER['REQUEST_URI'], "?"), 1), $_GET);[/b] // blehck $this->response(array( 'foo' => Input::get('foo'), 'baz' => array( 1, 50, 219 ), 'empty' => null )); }
. I stand corrected. There is a silver bullet. If, after adding the all-important "?" to .htaccess, you are still experiencing problems... here's the solution. Change the [L] flag (Last) to a [QSA] flag (Query String Append). Example:Evan Tishuk wrote on Wednesday 6th of July 2011:Given how many people have failed at solving this issue, I am not optimistic that there is a .htaccess silver bullet that will make this work.
RewriteRule ^(.*)$ /index.php?$1 [L]
RewriteRule ^(.*)$ /index.php?$1 [[b]QSA[/b]]
It looks like you're new here. If you want to get involved, click one of these buttons!