Add a prefix to all path with hook_url_outbound_alter and/or hook_url_inbound_alter
I finally made it but not without the help of a sympathetic module: PURL.

And here's my final solution:


Create a custom module
In the mymodule.module file create 3 functions:

/**
 * Implements hook_purl_provider
 */
function mymodule_purl_provider() {
  return array(
    'mymodule_provider' =&gt; array(
      'name' =&gt; t('My module provider'),
      'description' =&gt; t('Sets a prefix for URL.'),
      'callback' =&gt; '_mymodule_prefix',//I didn't really use this callback and I don't really know how to :-)
      'example' =&gt; 'my-prefix',//anything you want. only for UI I think
    ),
  );
}

function mymodule_purl_modifiers() {

  $mymodule_events = _get_all_events();//custom function to get some data

  foreach ($mymodule_events as $kid =&gt; $e) {
    $modtab['mymodule_provider'][] = array('value' =&gt; $e['alias'], 'id' =&gt; $e['nid']);//this array must be structured like this!
  }
  return $modtab;
}


function _mymodule_prefix(){
  $event = _get_one_event();//custom function

  if ($event) return true;
}



then you can go in /admin/config/search/purl to configure PURL with your data you've just created with mymodule.


In /admin/config/search/purl/types you select the type you need (I checked only "Path")
In /admin/config/search/purl/list you should see your modifiers you've created with mymodule.
And in /admin/config/search/purl you can select witch type you use for your provider


I am a bit sad because I didn't manage to use the 2 hooks (like purl does :-) but the good news is that "it works"

Cheers.