update logic to allow civicrm to be installed in /profiles

https://issues.civicrm.org/jira/browse/CRM-15405