2

How can I replace the '/civicrm/' portion of all site URLs automatically? I want change all the URLs so I cant do it one by one with a Drupal "URL alias".

Could I somehow swap the name 'civicrm' for a different string such as 'myOrg'? (eg: if someone visited /civicrm/admin?reset=1 they would be redirected to /myOrg/admin?reset=1 )

1
  • I would probably ask why this is even a requirement! It's easy to embed civi bits in custom pages, but I really don't see a problem with having civicrm in URLs.
    – JohnFF
    Mar 29 '16 at 10:23
2

There is no easy way to do this.

You might be able to create a drupal module that is able to get the myOrg urls and then renders the CiviCRM version of it.

But then you still have the problem that the internal links that CiviCRM creates will be in the /civicrm/* form.

To solve that you could first get the CiviCRM page as a string in the drupal module, then do a search/replace and output it.

Very hackish, probably not possible to get it 100% right. I would advise not to.

-1

Thank you @Catorghans for the answer,

I can not add a comment

I created a Drupal Module "myorg" to render CiviCRM URLs

function myorg_menu() { $items['myorg/admin/custom/group'] = array( 'title' => 'Custom Data', 'page callback' => 'CRM_Custom_Page_Group', 'access arguments' => array('Customize Data and Screens'), 'file' => 'CRM/Custom/Page/Group.php', 'file path' => 'sites/all/modules/custom/civicrm', ); return $items; }

when I accede to 'myorg/admin/custom/group', i have error :

Fatal error: Class 'CRM_Core_Page' not found in /projet/organisation/sites/all/modules/custom/civicrm/CRM/Custom/Page/Group.php on line 44

Not the answer you're looking for? Browse other questions tagged or ask your own question.