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.

  • 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 Sep 6 '11 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. – cigotete Sep 7 '11 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) – cigotete Sep 21 '11 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 Sep 28 '11 at 21:45
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;
}
  • 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). – cigotete Sep 21 '11 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 Sep 22 '11 at 6:38

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.