Subdomain for Controller
How would I go about making my ApiController link to api.example.com/? Thanks for any insight you can provide -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-...@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cake-php?hl=.
Re: Subdomain for Controller
Hi, you can check the subdomain in the configs/routes.php and create a route to your controller. $subdomain = substr(env(HTTP_HOST), 0, strpos(env(HTTP_HOST), .)); if ($subdomain == 'api') { Router::connect('/', array('controller' = 'api', 'action' = 'index')); } Not sure if there is a better way, hope that helps anyway. On 19 Nov., 09:35, Kyle Decot kdec...@gmail.com wrote: How would I go about making my ApiController link to api.example.com/? Thanks for any insight you can provide -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-...@googlegroups.com. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cake-php?hl=.
mod_rewrite + admin routing via subdomain - missing controller
hi there, i have the following problem: while i managed to get mod_rewrite running, it fails on my subdomain admin.localhost. ### part of appcontroller dump [controller] = AdminusersController [controllerName] = Adminusers ) [pageTitle] = Missing Controller ### part of appcontroller dump Obviously this leads to an error since the controller name is Users and not Adminusers maybe i should mention this patch, which enabled the admin routing via a subdomain in bootstrap.php if(env(HTTP_HOST) == admin.localhost){ $_GET[url] = admin . $_GET[url]; } elseif(strpos($_GET[url], admin) === 0){ header (HTTP/1.0 404 Not Found); die(); } any advise ? thanks, jyrgen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---