Change alias name for phpmyadmin

I need to change alias name for phpmyadmin.

Presently, when I need access to phpmyadmin, I type mydomain/phpmyadmin. I need to change that. Please help to advise. How to change?

Changing the Application's Access Location
In order for our Apache web server to work with phpMyAdmin, our phpMyAdmin Apache configuration file uses an alias to point to the directory location of the files.

To change the URL where our phpMyAdmin interface can be accessed, we simply need to rename the alias. Open the phpMyAdmin Apache configuration file now:

sudo nano /etc/httpd/conf.d/phpMyAdmin.conf

Toward the top of the file, you will see two lines that look like this:

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

These two lines are our aliases, which means that if we access our site's domain name or IP address, followed by either /phpMyAdmin or /phpmyadmin, we will be served the content at/usr/share/phpMyAdmin.

We want to disable these specific aliases since they are heavily targeted by bots and malicious users. Instead, we should decide on our own alias. It should be easy to remember, but not easy to guess. It shouldn't indicate the purpose of the URL location. In our case, we'll go with /nothingtosee.

To apply our intended changes, we should remove or comment out the existing lines and add our own:

# Alias /phpMyAdmin /usr/share/phpMyAdmin
# Alias /phpmyadmin /usr/share/phpMyAdmin
Alias /nothingtosee /usr/share/phpMyAdmin

When you are finished, save and close the file.

To implement the changes, restart the web service:
 
Basically do what the instructions say. The file paths look like a Red Hat derivative so keep in mind that will be different. On FreeBSD, the Apache configuration would be under /usr/local/etc/apache24/httpd.conf, the databases/phpMyAdmin port installs under /usr/local/www/phpMyAdmin, and the service restart would be service apache24 restart.
 
Now iI edit file httpd.conf in line:
Code:
If_module_alias    Add alias /php "/usr/local/compat/vhost/mydomain/htdocs/phpmyadmin"
I can access to my phpmyadmin via www.mydomina.com/php but iI no need access via /phpmyadmin
 
Back
Top