Change view & edit route or URL of Entities generated by Drupal Console I have generated a custom entity using Drupal Console. 

drupal generate:entity:content 


However, there is one serious problem. All the default route for the various operation related to that entity are coming under /admin/.. route. Which prevent non-admins from accessing those pages even if given permission for example to edit it. 

When I generate an entity called company. My routes are as below:


View Single Entiy: /admin/structure/company_entity/{company_entity}
Add Entity: /admin/structure/company_entity/add
Edit Entity: /admin/structure/company_entity/{company_entity}/edit
Delete Entity: /admin/structure/company_entity/{company_entity}/delete
List all Enitities: /admin/structure/company_entity


Where should we edit the module to override or change these settings.
You need to edit the entity class's annotation, at e.g. module_name/src/Entity/FooEntity.php.

This is an example of what you need from the Node entity class:

links = {
    "canonical" = "/node/{node}",
    "delete-form" = "/node/{node}/delete",
    "edit-form" = "/node/{node}/edit",
    "version-history" = "/node/{node}/revisions",
    "revision" = "/node/{node}/revisions/{node_revision}/view",
}


You'll probably need to rebuild cache for the changes to be reflected.