php - Symfony - Making dev environment inaccessible in prod -
I have recently deployed a Symphony project and have seen that Dev Environment is still accessible.
The following URL loads the prod version of the project:
I was thinking that Is it possible to make the Dev version impossible in the project environment? I appreciate any advice, thanks in advance! Add the following lines of code to your app_dev.php http://domain.com/app.php/index < P> The following URL version loads the project:
http://domain.com/app_dev.php/index
// This checkdog prevents access to front controllers which are positioned on the production server by accident. // Free to remove it, extend it, or refine something more. If (! In_array (@ $ _ SERVER ['REMOTE_ADDR'], array ('127.0.0.1', ':: 1',))) {header ('http / 1.0 403 prohibited'); Exit ('You do not have permission to access this file.' Check '.basename (__File__).' For more information. '); }
Comments
Post a Comment