Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathonbyrdziak/ffa9eac4aa38c1c8b5fa to your computer and use it in GitHub Desktop.
Save jonathonbyrdziak/ffa9eac4aa38c1c8b5fa to your computer and use it in GitHub Desktop.

You can set your own custom Magento admin URL in:

System -> Configuration -> [ADVANCED] -> Admin -> Admin Base URL

NOTE: Make sure you have added a ServerAlias directive to your virtual host configuration for backend.domain.com and that you have a SSL cert or wildcart setup for HTTPS traffic on that subdomain or you will lock yourself out the admin.

Rules for your .htaccess file to prevent duplicate urls and redirect directly to admin dashboard:

    # rewrite main domain /admin to custom admin backend
    RewriteCond %{HTTP:HOST} ^www\.domain\.com$
    RewriteCond %{REQUEST_URI} ^/admin
    Rewriterule (.*) https://backend.domain.com [R=301,L]

    # rewrite any backend domain request that is not /admin to /admin
    RewriteCond %{HTTP:HOST} ^backend\.domain\.com$
    RewriteCond %{HTTP_COOKIE} !^.*adminhtml.*$ [NC]
    RewriteCond %{REQUEST_URI} !/admin/
    RewriteRule .* %{REQUEST_URI}index.php/admin/ [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment