Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 阻止移动(iOS/Android)访问magento中的单个CMS页面_.htaccess_Magento - Fatal编程技术网

.htaccess 阻止移动(iOS/Android)访问magento中的单个CMS页面

.htaccess 阻止移动(iOS/Android)访问magento中的单个CMS页面,.htaccess,magento,.htaccess,Magento,在apache中,我想我可以使用.htaccess访问控制选项 例如: SetEnvIf用户代理BadBot GoAway=1 命令允许,拒绝 通融 拒绝来自env=GoAway 但是如何阻止移动设备(iOS/Android)访问magento中的单个CMS页面???观察match方法中的CMS\u controller\u router\u match\u Prefore事件,并检查observer方法中的user agent标头。可能,请参阅 public function checkRes

在apache中,我想我可以使用.htaccess访问控制选项

例如: SetEnvIf用户代理BadBot GoAway=1 命令允许,拒绝 通融 拒绝来自env=GoAway


但是如何阻止移动设备(iOS/Android)访问magento中的单个CMS页面???

观察match方法中的
CMS\u controller\u router\u match\u Prefore
事件,并检查observer方法中的user agent标头。可能,请参阅

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);
    }
}