Moving, Removing, Disabling Administration on live server On my staging server people should be able to access the administration to add, delete or edit content. The complete installation including the database is then deployed to a live server. On the live server I don't want anyone to be able to access the administration. In other words if a user goes to mylivesite.com/admin the response would be a 404 - not found. What would be the best approach to achieve this?
The best approach would be to deny access to the administration pages for certain roles on your live site using standard Drupal permissions ( http://example.com/admin/people/permissions ).

The permission you're looking for is called "Use the administration pages and help".

Returning a 404 for all admin pages doesn't seem like the correct thing to do here, as the page has been found. A 403 is the correct semantic response for this.

If you're desperate, having the following code in a module on your live site only would do the trick:

function MYMODULE_init() {
  if (arg(0) == 'admin' &amp;&amp; $GLOBALS['user']-&gt;uid != 1) {
    drupal_not_found();
  }
}


But I can't say I'd recommend it :)