1

This is the scenario: I have a Drupal 6 site, and another website that doesn't use Drupal. This 'other site' is in the same server, and the same hosting account. I need Drupal to be over the other website with his theme, regions, blocks and sessions/roles/authentication. The other website must conserve its own system of session, authentication, content and their URLs (but like already said, the theme, blocks, regions, authentication, must come from Drupal).

Update: iframe is not an alternative (SEO issues).

Update: This guide Integrating third party applications seems useful, but certainly I do not know how to implement it.

4
  • 1
    have you thought about migrating the other site into Drupal? If you insist on using iframes, check stackoverflow.com/questions/525992/… for example
    – zerolab
    Commented Sep 6, 2011 at 18:50
  • Hi zerolab, I will review your iframe suggestion. Migration is not an alternative because the external site are using a different information flow than Drupal.
    – MWt
    Commented Sep 7, 2011 at 0:01
  • @zerolab, your suggestion give me a fast iframe, thanks (the iframe is not an alternative due SEO requirement (the other site must conserve their URLs), but was a good recomendation)
    – MWt
    Commented Sep 21, 2011 at 22:52
  • Just stumbled upon a post on Drupal4hu, called "Making a new site appear within the old" which deals with a very similar use case. The solution is, however, Drupal 7-based. I take it a combination of that and yvan's answer could be a lot better than trying iframes.
    – zerolab
    Commented Sep 28, 2011 at 21:45

1 Answer 1

2

If you've, at least, any control on the second web site you can do it with dynamic includes. It works not so bad with the help of an own module.

The idea its to create a module that do a file_get_content() and return it to Drupal that gonna show the content.

But, for it your second web site should have relative paths between his pages, or you will make the change with a regex.

There an example module, no tested.

function mymodule_menu() {
  $items = array();

  $items['inc/%'] = array(
    'title' => t("Include"),
    'page callback' => 'mymodule_include',
    'page arguments' => array(1)
  );

  return $items;
}

function mymodule_include($path) {
  $http = 'http://example.com/';
  // Maybe check if the page is available 
  // better to use drupal_http_request for that
  $content = file_get_contents($http . $path);

  // Perform any change in the content before to
  // send it for render.
  return $content;
}
2
  • thanks a lot for your answer. with your answer proposed, not is clear to me how 'non-Drupal' site can conserve their content urls (SEO requirement. I will make this more clear in my question).
    – MWt
    Commented Sep 21, 2011 at 22:40
  • The idea its to catch all path from Drupal, first you if the path exists on Drupal, the Drupal handler is used, after you check the path in the second site if is exist and if the case you get the content and show it with Drupal and finally if either don't exists, you show a 404 error.
    – yvan
    Commented Sep 22, 2011 at 6:38

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.