Version: Magento 1.x
Problem:
Change the admin domain. e.g. admin.mydomain.com
Solution:
1. Add entry to hosts file e.g. 127.0.0.1 admin.mydomain.com
2. Add entry to httpd-vhosts e.g.
<VirtualHost *:81>
ServerAdmin admin@admin.com
DocumentRoot "c:\mywebsite"
ServerName admin.mydomain.com
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
<directory "c:\mywebsite">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</directory>
</VirtualHost>
3. Update Magento config as follows:
System->Configuration->General->Web->URL Options->Auto-redirect to Base URL = No
System->Configuration->Advanced->Admin->Admin Base URL->Use Custom Admin Path = Yes
System->Configuration->Advanced->Admin->Admin Base URL->Custom Admin Path = http://admin.mydomain.com/
*This is the full URL with “http://”, admin domain, slash at the end “/”.
4. Clear Magento cache.
5. Admin site is accessible here: http://admin.mydomain.com/admin/