Page 1 of 1

Limit phpmyadmin htaccess

Posted: Tue Mar 10, 2020 12:08 am
by mihacb
Hello friends! In order to limit access to phpmyadmin from outside, only from vesta panel.
I made .htaccess in folder /usr/share/phpMyAdmin

Code: Select all

RewriteEngine On
RewriteCond %{HTTP_REFERER} !()?site.ru
RewriteRule .* - [F]
From Vesta i can go to site.ru/phpmyadmin/ - it's ok,

- but when i try to log in to the base, i have:
Forbidden
You don't have permission to access /phpmyadmin/index.php on this server.
I think it is due to HTTP_REFERER doesn't transmit to index.php script

Does anybody know, how to fix it?

Re: Limit phpmyadmin htaccess

Posted: Sun May 10, 2020 7:32 pm
by skamasle
This not works, because you are referer only first time, once you are in login page your access is direct

The better way to do this, is modify index.php and handle session from vestacp

Re: Limit phpmyadmin htaccess

Posted: Fri Jun 12, 2020 11:24 pm
by mihacb
skamasle wrote:
Sun May 10, 2020 7:32 pm
This not works, because you are referer only first time, once you are in login page your access is direct

The better way to do this, is modify index.php and handle session from vestacp
Thank you for your reply! Could you write the necessary code and in which files i need it change?

Re: Limit phpmyadmin htaccess

Posted: Mon Jun 15, 2020 9:12 pm
by skamasle
mihacb wrote:
Fri Jun 12, 2020 11:24 pm
skamasle wrote:
Sun May 10, 2020 7:32 pm
This not works, because you are referer only first time, once you are in login page your access is direct

The better way to do this, is modify index.php and handle session from vestacp
Thank you for your reply! Could you write the necessary code and in which files i need it change?
HI, I cant help you, I not control the PHP part