Hello,
Bit of a weird one that I'm not sure should go in a as bug or a feature request. Or that I simply don't understand 
I discovered this on link assets (and potentially rest assets) but it could be happening elsewhere:
If a url is hard coded in the url attribute of a link asset and if that url is the same domain as the Matrix install but is not managed by Matrix, the CMS gets confused.
So for example, I run Matrix on this:
http://www.mysite.com
But I run another app here:
http://www.mysite.com/other-app
If I enter the url 'http://www.mysite.com/other-app' as the URL attribute of a link asset, weird things start to happen. In most cases this is invisible, if you print the asset url for this link asset for example, it will print that url correctly.
But if you print this keyword: %link_target_asset_assetid%, even though the 'or asset' attribute is empty, Matrix still returns something. It appears to think that the hard coded url is referencing an asset, tries to find the name of that asset, fails and defaults to the site asset.
I haven't tried all the link_target_ keywords (only %link_target_asset_name% and %link_target_asset_assetid%) but would think they do the same. If I'm not pointing to an asset in the system though, I would expect these to be empty and not the current site asset.
We've had another case where we're not sure what is happening but could potentially be the same issue. If I take the same set up as before and point a rest asset to…
http://www.mysite.com/other-app
…the call fails silently. I'm not entirely sure this is the same issue at all so take that second example with caution but it seems strangely related, the same rest asset working fine when making calls to external url not within the same domain.
Is this a server/matrix configuration issue? Or is this due to how Matrix works and how it tries to map a url to an asset if it can before moving on?
Gilles
You can't install apps that shares same root domain with Matrix, because it doesn't know there is a third-party app installed with that path, it assumes all URLs are managed by Matrix.
Probably you should consider moving the app to a different domain, or a sub domain that is not part of Matrix's root URLs.
If they must be on the same server and domain, depending on the app (if it's basic enough) you may be able to add a directory to core/lib/, eg core/lib/my-app and reference it via mysite.com/__lib/myapp
Or another option would be to add an alias above the matrix aliases (in httpd.conf), eg:
...
Alias "/my-app" "/path/to/my-app"
Alias "/__data" "/gfs001/mysource_matrix/data/public"
...
The app we've got installed on the same domain as Matrix are working properly though. The issue we're having is for some specific cases, when the app urls are used for an asset attribute or field.
I'm not a php developer so I can't have a look at the code, but I suppose it's core functionality Matrix trying to map urls to assets if possible, and that it can't be changed easily.
Anyway, thanks for the help!