1

I am using Drupal 7 with single installation. Requirement here is to serve node content which belongs to sub-domain

Example:

if user try abc.mysite.com then system will internally serve content from

mysite.com/node/abc but user will not see any change in URL

What i have tried so far but failed:

  1. htaccess modification
  2. Subdomain module
  3. Drupal hook "hook_url_inbound_alter"

Here "abc" subdomain is dynamic as this is related to node content.

Please Help!!!

0

This should be pretty simple to do with some mod_rewrite rules. Apache's mod_rewrite supports proxying requests.

0

I finally solved this by using menu_execute_active_handler() function. Here are the steps.

  1. Hook up initial request by defining custom menu path as your landing page.
  2. In callback function of landing page, use code to determine sub domain.
  3. On basis of sub domain, we can query out desired path and display by passing it to menu_execute_active_handler() function.
  4. If sub domain is not available then we can skip/redirect to default execution.

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.