Welcome Guest, Not a member yet? Register   Sign In
route + .htaccess = not passing parameters
#1

[eluser]Unknown[/eluser]
Hello,

I realize it's a well known issue but I really got stuck when passing params to a controller.
My .htaccess looks as follows:

Code:
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]

I have a simple route:

Code:
$route['([^/]+)-page/:num/'] = "pages/test/$1/$2";

I'm able to access it as folows:
http://domain.com/blah-page/1
I can retrieve the "blah" param with $this->uri->rsegments.

Ideally, I'd like to be able to build it as follows:

Code:
$route['([^/]+)-page/:num'] = "pages/test/sub/$1/p/$2";

and then in controller:

$_GET['sub'], $_GET['p']
or
$this->something->get('sub'), $this->something->get('p')

$config['uri_protocol'] = "AUTO"; (tried also with "PATH_INFO")
also, http://ellislab.com/forums/viewthread/56389/#277621 didn't work.

is it possible?




Theme © iAndrew 2016 - Forum software by © MyBB