Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://9364993dce19.ngrok.io/ code example

Example: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary

Inside /etc/apache2/apache2.conf Replace

<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted
to
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted

and

<Directory /usr/share> AllowOverride None Require all granted
to
<Directory /usr/share> AllowOverride All Require all granted

Run these commands

sudo a2enmod rewrite
sudo service apache2 restart

Inside your .htaccess file

DirectoryIndex index.php

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule .? - [L]

    RewriteRule .? %{ENV:BASE}/index.php [L]

</IfModule>