Reputation: 515
I am using CodeIgniter Framework with this .htaccess
command for "nice urls".
RewriteCond $1 !^(index\.php|assets|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php?$1 [L]
All URLs, for e.g.:
example.com/admin/xxx/
example.com/index.php?admin/xxx/
(look like CodeIgniter's ?/class/method/
)But question is: How can I pass $_GET
paramaters? For Example:
example.com/admin/xxx/?action=die&time=now
I need use GET
params od external ajax scripts (f.e.: ElFinder based on CODEIGNTER)
Thanks for advices
Edit:
I solved this problem just using POST method at Elfinder:
Elfinder - Request type
But btw using $_GET params in codeigniter with mark "?" with this .htaccess, is impossible
Upvotes: 0
Views: 470
Reputation: 33710
Have you read through the CodeIgniter documentation on URI segments?
It explains how you could pass through your action
and time
parameters.
For example example.com/admin/xxx/die/now
would match up to the Controller
class Admin extends CI_Controller {
public function xxx($action, $time) {
// Stuff
}
}
Alternatively as @War10ck suggested you could Use the Input
class to get the required $_GET
parameters. e.g.
class Admin extends CI_Controller {
public function xxx() {
$action = $this->input->get('action');
$time = $this->input->get('time');
}
}
Upvotes: 1