Posts Tagged ‘params’

Sending url parameter through _GET and Cake convention

Yesterday I tried to pass an ‘url’ GET parameter to cake but I got a ‘Http controller missing‘ error. Here is the url:
http://www.example.com/images/notify?myid=456&time=782638762863&url=http%3A%2F%2Fwww.cakephp.org
After a while I remembered that CakePHP uses the ‘url’ parameter when using mod_rewrite:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

This means that every request after the domain name is added to the url parameter. F.e.:
http://www.example.com/items/view/1234 will be transformed to http://www.example.com/index.php?url=items/view/1234. This means we cannot use the ‘url’ parameter ourselfs. (more…)