: APACHE2: avoid https:// REDIRECT to open phpmyadmin I have a site https://example.comto ensure that all users go to the https:// I set up a redirect with APACHE (on the default.conf) as followed:
I have a site example.comto ensure that all users go to the I set up a redirect with APACHE (on the default.conf) as followed:
<VirtualHost *:80>
ServerName example.com
Redirect permanent / example.com # DocumentRoot /var/www/example.com/
<VirtualHost *:80>
My issue is when I try to access my phpmyadmin example.net/phpmyadmin I redirect to example.net/phpmyadmin and the page cannot be displayed.
(It is obviously working if I remove the Redirect).
How can I get avoid the redirect only for my phpmyadmin?
Any idea?
More posts by @Annie201
2 Comments
Sorted by latest first Latest Oldest Best
You could disable ForceSSL within PHPMyAdmin but there's a reason why its forced and this is to make the connection more secure. I recommend that you move to doing redirects using .htaccess rather than using virtualhost method, by doing so you have more control on your redirects for each of your web applications.
In /var/www/.htaccess it should look something like:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) %{HTTP_HOST}%{REQUEST_URI}
then in /usr/share/phpmyadmin/.htaccess use something like:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ %{HTTP_HOST}%{REQUEST_URI} [L,R=301]
A way around:
I do not know why but if I type as url example.net/phpmyadmin I will be redirected to example.netphpmyadmin/ but if I write example.net/phpmyadmin/ (with the /)I go to php my admin.
No idea why but I hope it will be of help to others.
to force on pyp myadmin I added: $cfg['ForceSSL'] = true; at the end of phpMyAdmin’s config.inc.php file (see thebarton.org/forcing-ssl-with-phpmyadmin/).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.