page_handler.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Pages handler.
  4. *
  5. * This file dispatches pages. It is called via a URL rewrite in .htaccess
  6. * from http://site/handler/page1/page2. The first element after site/ is
  7. * the page handler name as registered by {@link elgg_register_page_handler()}.
  8. * The rest of the string is sent to {@link page_handler()}.
  9. *
  10. * Note that the following handler names are reserved by elgg and should not be
  11. * registered by any plugins:
  12. * * action
  13. * * cache
  14. * * services
  15. * * export
  16. * * js
  17. * * css
  18. * * rewrite.php
  19. * * tag (deprecated, reserved for backwards compatibility)
  20. * * pg (deprecated, reserved for backwards compatibility)
  21. *
  22. * These additionally are reserved for the xml-rpc plugin
  23. * * mt
  24. * * xml-rpc.php
  25. *
  26. * {@link page_handler()} explodes the pages string by / and sends it to
  27. * the page handler function as registered by {@link elgg_register_page_handler()}.
  28. * If a valid page handler isn't found, plugins have a chance to provide a 404.
  29. *
  30. * @package Elgg.Core
  31. * @subpackage PageHandler
  32. */
  33. require_once(dirname(dirname(__FILE__)) . "/start.php");
  34. register_error("Update your .htaccess file to remove the page handler");
  35. $router = _elgg_services()->router;
  36. $request = _elgg_services()->request;
  37. if (!$router->route($request)) {
  38. forward('', '404');
  39. }