disabled app and app_dev.php on my server prod Symfony 2.3

apache, symfony

Solution

Dev env should only be accessed on the server where you are developing. That said, you could do it in Apache, but Symfony does it for you automatically.

From app_dev.php:

if (isset($_SERVER['HTTP_CLIENT_IP'])
    || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
    || !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}

Just add the IPs you want to be able to access from in the array.

Problem

I move my project to my server and I do not want that app and app_dev and all dev environments are available It would be even better if I could filter out the ip that have permission to access the server prod in dev environment (app_dev.php) I have to change apache or Symfony? Thanks !

Original source