0

I have separated our magento setup into load balanced frontend servers and a single admin backend server. I have specified : web/url/redirect_to_base = 0 and have setup the custom admin url in database.

The access to magento admin panel works fine at http://admin.magento.com/customadminpath but the homepage url http://admin.magento.com/ now shows the webstore frontend which is not what I wanted.

How can I redirect any requests for homepage on admin server to the admin url with admin path?

I have tried putting rewrites in nginx but couldn't get it to work. What I'm trying to setup here is any requests to admin.magento.com should be redirected to admin.magento.com/customadminpath so that no one can access the frontend pages on admin.magento.com.

Also, what's the correct approach for this, through nginx configuration or change in the index script?

1

Use .htaccess to set up the 301 redirect for you:

Setting up a permanent 301 redirect via .htaccess

Edit: Alternatively for nginx:

What is nginx equalant for my htaccess mod_rewrite?

  • I'm not using apache, I am using nginx. Should have made it more clear. – Anil Jaiswal Nov 10 '14 at 12:17
  • Just updated my answer for the nginx equivalent, should have seen your mention :) – Moose Nov 10 '14 at 12:19
  • Could you share some code examples in the comment to achieve the solution? – Anil Jaiswal Nov 10 '14 at 12:22
0
requests to admin.magento.com should be redirected to admin.magento.com/customadminpath 
so that no one can access the frontend pages on admin.magento.com.

forgive me, but what a stupid idea... do you understand the problem behind this?? what is the point of setting up non-default admin path, and then automatically redirect to this path??

you better at load balancer cut all these requests, and only open admin page on your custom path, others must go back to frontend servers.

btw - no one will be able to open anything on admin server, it will be redirected back to www. , and even these requests in properly configured load balancer should return 502, 504

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.