Posts Tagged ‘htaccess’
Mapping content over domains with Apache
Posted by primeminister | Filed under Cake-Toppings, Other (tech) stuff
Using ‘Dynamic Mirror‘ in Apache you can map content from one domain to another. This was useful for a customer who had two very old domains from 1993 and built-up a nice SEO ranking.
We have two domains a-domain.com and b-example.com. The last one has a new design and some different links and is an application built in CakePHP.
The other domain ‘a-domain.com’ had its purpose to serve the same content. (more…)
Sending url parameter through _GET and Cake convention
Posted by primeminister | Filed under Cake-Toppings
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…)