I'm currently working on a Drupal project that requires 3 separate interfaces.

Administrative users login to the site and all of the pages associated with their specific role start with a particular base path. Lets say it is /path_A/*. I'd like these users to login to the site using www.example.com/path_A/login and all subsequent requests to any given page would be accessed via www.example.com/path_A/.

The end users would access the site in the same way except the login page and all subsequent requests would begin with www.example.com/path_B. Users of path B should not be able to access any of the administrative functions tied to path_A/ but administrators should be able to navigate to any path_B/ URL and access the site in the same way as the end users.

On top of all of this, there is a public facing set of pages that should be accessed using the domain itself, it is basically a blog and information directory living at the webserver root directory (www.example.com).

Additionally none of the pages belonging to any of these specific URL paths should be available through the others, so a page /path_A/page/3 should not be accessible via /path_B/page/3 or /page/3. Multi site setup for this is not really an option since the a large piece of the database is shared by all three subsections of the site.

My initial idea is that I could use .htaccess rewrites to direct all requests to each of the paths to the drupal index file, register 2 aliases for each of the login pages using the paths module and then use context to change the interface based on the path/role. I am a bit new to drupal and this is my first major project working with it so I'm not sure if this is the best approach to this problem. And yes I realize that this might seem like a waste of time but the client really stressed this functionality.

1 Answer 1


Role Theme Switcher does what you're asking for roles. For access to pages you could write your own custom module that implements hook_node_access or you could use Views permissions (which I've found to be quite easy and works well) or you could use another module that manages permissions on a per-page basis like Content Access or Nodeaccess.

Lots of options for what you want. I personally recommend trying to combine Role Theme Switcher with Views permissions. Otherwise I would go for making a custom module with hook_node_access. I don't recommend Content Access or Nodeaccess, they've never worked exactly right for what my needs are, but they are there for reference.

EDIT: You may also find Rules to be helpful re-directing users of certain roles to certain pages based on their role when they login.

EDIT 2: As I mentioned in the comment below, logintoboggan is another module that will allow re-directs upon user login.

  • I've heard that using the rules module to redirect can result in some problems during the login process. Also how would I account for base path differences with this set up, just path aliases? Apr 7, 2014 at 17:27
  • @JohnnyEmptyString If you find that this gives you problems, the logintoboggan module will let you re-direct users on login.
    – CR47
    Apr 8, 2014 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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