<code>access_control: - { path: ^/site/admin/*, roles: ROLE_ADMIN } firewalls: config.yml | 17 dev: config_dev.yml | 18 pattern: ^/(_(profiler|wdt)|css|images|js)/ config_prod.yml | 19 security: false config_test.yml | 20 parameters.yml | 21 login: parameters.yml.dist | 22 pattern: ^/site/admin/login$ routing.yml | 23 security: false routing_dev.yml | 24 security.yml | 25 secured_area: pattern: ^/site/admin/ form_login: AppCache.php | 28 check_path: _admin_check AppKernel.php | 29 login_path: _admin_login autoload.php | 30 logout: bootstrap.php.cache | 31 path: _admin_logout check.php | 32 target: _site console* | 33 #anonymous: ~ phpunit.xml.dist | 34 #http_basic: SymfonyRequirements.php | 35 # realm: "Secured Demo Area" </code>
我访问http://url/site/admin 没有跳转到指定的login页面....
<code>access_control: - { path: ^/site/admin/*, roles: ROLE_ADMIN } firewalls: config.yml | 17 dev: config_dev.yml | 18 pattern: ^/(_(profiler|wdt)|css|images|js)/ config_prod.yml | 19 security: false config_test.yml | 20 parameters.yml | 21 login: parameters.yml.dist | 22 pattern: ^/site/admin/login$ routing.yml | 23 security: false routing_dev.yml | 24 security.yml | 25 secured_area: pattern: ^/site/admin/ form_login: AppCache.php | 28 check_path: _admin_check AppKernel.php | 29 login_path: _admin_login autoload.php | 30 logout: bootstrap.php.cache | 31 path: _admin_logout check.php | 32 target: _site console* | 33 #anonymous: ~ phpunit.xml.dist | 34 #http_basic: SymfonyRequirements.php | 35 # realm: "Secured Demo Area" </code>
我访问http://url/site/admin 没有跳转到指定的login页面....
http://url/site/admin没有被firewall的pattern(^/site/admin/)包含。