Friday, June 6, 2014

Redirect Loop when PhpMyAdmin as SubFolder in Laravel Public Directory

If you use laravel in a hosting then you add PhpMyAdmin as subfolder in Laravel Public Directory, you may get error message as seen in image below:


For the solution, you can do one of the following guide:
1. Visit PhpMyAdmin with:
 http://yourdomain.com/phpmyadmin/index.php 
or
2. Open .htaccess file in laravel public folder, then comment out/remove line below:
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301] <-- Comment Out or Remove this line

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
That's it, you can access PhpMyAdmin normally.

2 comments:

  1. This just helped me out a bunch .Thanks!

    ReplyDelete
    Replies
    1. Your welcome. Glad to see this writing can solve your problem.

      Delete