php - Symfony 2 routing doesnt work in prod -


itemprop = "text">

IM has developed a very simple blog in Symphony, there are two bundles: Blogs and administrators that are both fine in the Dev environment. However, the main administrator route starts working in prod because it throws 404. Every other route (such as / admin / categories and so on) works but / admin only if I /app_dev.php/admin writes then works already has approved the cache. I do not think I'm the admin I have written some code to block, I do not know where I can do such things .. Besides, it is not even known how code snippets need debugging, but if someone A question I'll update.

> Administration route:

  admin_image_upload: Path: / Imageupload default: {_controller: SzoBeszAdminBundle: admin: imageUpload} admin_posts: Path: / admin defaults: {_controller: SzoBeszAdminBundle: Administrator: Index} admin_posts_paginated: path: / admin / posts / {PAGENUMBER} default: {_controller: SzoBeszAdminBundle: admin: index} admin_categories: path: / admin / classes missed: {_controller: SzoBeszAdminBundle: admin: category} admin_category_submit: path: / admin / Categorysubmit defaults: {_controller: SzoBeszAdminBundle: admin: categorySubmit} admin_post_submit: path: / admin / postsubmit omission: { _controller: SzoBeszAdminBundle: admin: postSubmit} requirements: _method: received | Post Man n_post_edit: Path: / admin / post / edit / {id} defaults: {_controller: SzoBeszAdminBundle: admin: postEdit} Needs: ID: \ d + admin_post_delete: Path: / admin / post / delete / {id} defaults : {_controller: SzoBeszAdminBundle: admin: PostDelete} requirements: id: \ d + admin_category_edit: path: / admin / class / edit / {id} default: {_controller: SzoBeszAdminBundle: admin: CategoryEdit} requirements: id: \ d + Admin_category_delete: Path: / Admin / Category / Delete / {ID} Default: {_controller: SzoBeszAdmin Bundle: Admin: categoryDelete} Requirements: ID: \ d +  

blog route:

  blog_homepage: path: / default: {_controller: BlogBundle: main index} requirements: _method: GET blog_homepaginated: path: / page / {PageNumber} default: {_controller: Blogbndl main index} Blog_categorypage: path: / {TheCategory} default: {_ controller: Blogbndl: ma: ShowCategory} Requirements: _method: GET blog_categorypaginated: Path: / {theCategory} / page / {pageNumber} Default: {_controller: BlogBundle: Main: showCategory} Requirements: _method: GET blog_tagpage: Path: / tag / {tag} Default: {_contr Oller: BlogBundle: Main: Tag} Blog_showpost: Path: / {TheCategory} / {Title} Defaults: {_controller: Blogbndl: Main: Sopost} requirements: _method: GET blog_tagpaginated: Path: / Tags / {tag} / pages / { Page_number} Default: {_controller: BlogBundle: Main: Tag}  

Security:

  Security: Encoder: Symphony \ Component \ Security \ Core \ User \ user: plane role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] providers: In_memory: memory: users: szobeszadmin: {password: *** roles: [ 'ROLE_SUPER_ADMIN']} firewalls: Dev: Petter N: ^ / (_ (profiler | Wdt) | CSS | Picture | JS: / Security: Wrong admin_secured: pattern: ^ / anonymous: ~ http_basic: realm: "safe zone" access_control: {path: ^ / administrator, roles: ROLE_SUPER_ADMIN}  

 
$ bundles = array (...);

Skip the registered dev bundles like this:

  if (in_array ($ this-> getEnvironment ()), array ('dev', 'Test'))) {$ bundle [] = new symphony \ bundle \ webprofilebundle \ webprofilebundle (); $ Bundles [] = new sensio \ bundle \ distributionband \ sensia distribution bundle (); $ Bundle [] = new sensio \ bundle \ generatorbundle \ sensoratorbender (); }  

In addition, if you are looking for a false in the AP.php file (the parameter is for testing):

  $ kernel = New AppKernel (' Prod ', false);  

Change the wrong to false:

  $ kernel = New AppKernel ('prod', true);  

Hope this helped, be a good day.


Comments