phpmyadmin

Discussion in 'Server Operation' started by mbensoussan, Mar 3, 2020.

  1. mbensoussan

    mbensoussan New Member

    Last edited: Mar 3, 2020
  2. Steini86

    Steini86 Active Member

    Depends on your configuration. Probably you have a config file for phpmyadmin in /etc/apache/sites-enabled/
    Inside there is an "Alias /phpmyadmin /usr/share/phpmyadmin". This adds the link from anything/phpmyadmin to the interface.
    You can remove this file and add the configuration just to the domain you want. Or you add the domain instead of the wildcard.
    For ISPconfig you would have to edit file "/etc/apache2/sites-enabled/000-ispconfig.vhost"
    But that is probably not a good idea:
    1. It will be overwritten by an ispconfig update
    2. It could break your config and ispc will not be available
     
  3. mbensoussan

    mbensoussan New Member

    yes i haved try to edit this file :
    pico /etc/apache2/conf-enabled/phpmyadmin.conf

    and i put this :

    Code:
    <Directory /usr/share/phpmyadmin>
        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteCond %{REQUEST_URI} ^/phpmyadmin
        RewriteRule ^/?(.*) https://ns457896.ip-50-251-142.eu/%{REQUEST_URI} [L,R=301]
    
    restart apache.
    it's make nothing. like the rewritecond don't work.
     
  4. Steini86

    Steini86 Active Member

    Everything after a "#" is a comment. So for sure adding a comment does nothing.
     
  5. mbensoussan

    mbensoussan New Member

    no i comment them because it doesn't work ;)
     
  6. Steini86

    Steini86 Active Member

    Have you tried with http?
    You have two conditions:
    1. If connection is via http
    2. If url is /phpmyadmin
    Then redirect. So if you connect via https, condition is not met.
    I am not sure, but you might need to specify a rewritebase, since phpmyadmin is an alias. (?)
    http://httpd.apache.org/docs/2.4/en/mod/mod_rewrite.html#rewritebase

    Also try with incognito mode of browser. Rewrites are being cached so that changes will not be seen immediately.
     
    Last edited: Mar 4, 2020
  7. mbensoussan

    mbensoussan New Member

    mm i try different kind of rewrite nothing work .... :(
     

Share This Page