Hi, I'm using Ubuntu 18.04 and ispconfig 3.1. i have installed phpmyadmin. I want to rewrite all direct access with ip to my hostname. i have a secure url like this : https://ns485748.ip-99-99-199.eu:8080/phpmyadmin/ but i can access to phpmyadmin with the ip of my server (without https) : http://50.50.50.50/phpmyadmin/ The same for ISPconfig. Where i have to put the rewrite condition ?
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: It will be overwritten by an ispconfig update It could break your config and ispc will not be available
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.
Have you tried with http? You have two conditions: If connection is via http 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.