Mobile app version of vmapp.org
Login or Join
Annie201

: 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:

@Annie201

Posted in: #301Redirect #Apache2 #Https #Phpmyadmin #Redirects

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

2 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi995

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]

10% popularity Vote Up Vote Down


 

@Annie201

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/).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme