1

in apache I guess i could do something like .htaccess Access Control option.

For eg: SetEnvIf User-Agent BadBot GoAway=1 Order allow,deny Allow from all Deny from env=GoAway

but how to block mobile (iOS / Android) access to a single CMS page in magento????

jon
  • 377
  • 2
  • 6
  • 20

1 Answers1

2

Observe the cms_controller_router_match_before event from the CMS router's match method and check the user agent header in the observer method. Possibly, refer to this SO post.

public function checkRestrictAccess(Varien_Event_Observer $o)
{
    /**
     * Browser detection logic will go here.
     */

    if (mobile browser == true && $o->getCondition()->getIdentifier() == 'page-id') {
        $o->getRequest()->setRedirectUrl(Redirect Url);
    }
}
Community
  • 1
  • 1
benmarks
  • 23,384
  • 1
  • 62
  • 84