Configuration for SSL redirect on Heroku causing error 403 (Forbidden) when accessing root domain

I have a PHP website that was working properly, hosted on Heroku (apache). I have just configured SSL and I would like to force users using https. Then I've found some instructions to do that on Heroku, using 'Procfile' approach, a file where I can write mod_rewrite directives and execute what I need.

You can see the code for my Procfile below:

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This code worked fine, in respect of redirect funcionality, but the problem is that I am receiving the following message when I am accessing the root domain (


You don't have permission to access / on this server.

When I explicitly type "", it works fine.

Can someone help me?