title: symfony 3 Too Many Redirects when forcing https
body: <p>I have a problem that is similar to other question posted on SO, but none of those solutions have worked.</p>
  
  <p>I'm using Apache built into OSX El Capitan Server, and https works fine when I don't <em>force</em> http traffic onto https via the following directive:</p>
  
  <pre><code>    access_control:
      - { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https, host: mypc\.local$ }
  </code></pre>
  
  <p>But adding this results in the Too Many Redirects error when visiting the local uri for my website is: <code>https://mypc.local/myproject/web/</code></p>
  
  <p>full <code>security.yml</code>:</p>
  
  <pre><code>security:
    access_control:
      - { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https, host: mypc\.local$ }
  
    providers:
      our_db_provider:
          entity:
              class: AppBundle:Users
              property: username
  
    encoders:
      AppBundle\Entity\Users: plaintext   
  
  firewalls:
      # disable authentication for assets and the profiler 
      dev:
          pattern: ^/(_(profiler|wdt)|css|images|js)/
          security: false
  
      main:
          pattern:    ^/
          http_basic: ~
          provider: our_db_provider
  
          anonymous: ~
          form_login:
              login_path: /
              check_path: login
  
          logout:
              path:   /logout
              target: /
              invalidate_session: true 
  </code></pre>
  
  <p>EDIT:
  here are the response headers:</p>
  
  <pre><code>&gt; GET /myproject/web/ HTTP/1.1
  &gt; Host: mypc.local
  &gt; User-Agent: curl/7.43.0
  &gt; Accept: */*
  &gt; 
  &lt; HTTP/1.1 301 Moved Permanently
  &lt; Date: Tue, 09 Aug 2016 12:15:00 GMT
  &lt; Server: Apache
  &lt; X-Powered-By: PHP/5.5.31
  &lt; Cache-Control: no-cache
  &lt; Location: https://mypc.local/myproject/web/
  &lt; MS-Author-Via: DAV
  &lt; Content-Length: 396
  &lt; Content-Type: text/html; charset=UTF-8
  &lt; 
  * Ignoring the response-body
  * Connection #0 to host mypc.local left intact
  * Issue another request to this URL: 'https://mypc.local/myproject/web/'
  * Found bundle for host mypc.local: 0x7f89b2d01780
  * Re-using existing connection! (#0) with host mypc.local
  * Connected to mypc.local (fe80::ea06:88ff:fecf:61c6) port 443 (#0)
  &gt; GET /myproject/web/ HTTP/1.1
  .... repeated 20 times
  </code></pre>