But when I copied the database to my test environment, the document's Url property is an absolute URL : http://sjónleikarhúsið.com/productionlist/holub%C3%BAgvan2017/
Is there a configuration file somewhere where I can fix this?
(That the test page links to the production site, is a small problem. The big problem is that the strings returned have different structure. On the test server, I can use them to construct new Url objects, in production, that does not work.)
I found the solution for my problem. On my root document, the domain was set to the production production domain on both test and production sites, I changed that to the localhost in the test environment.
Find the root of the content, Actions > Culture and Hostnames.
I can also simply delete the domain name to get absolute paths. In my case, I should probably leave it blank in both environments, allowing me to test on a pure copy of the production database.
But it worries me that the format of the Url property can change between absolute path (/home), and absolute URL (http://example.com/home). (If I use the Url property to construct an Url object, I'm in for a nasty surprise when the format changes to absolute path.)
The rule seems to be that we get absolute path if we do not specify domain, or specify the domain we actually run on.
If we have specified another domain, we get an absolute URL.
The document Url property: Absolute URL or absolute path?
On my production site, a document's Url property ("Link to doument") is an absolute path, e.g.
/holub%C3%BAgvan2017/
, which resolves to the absolute URL http://sjónleikarhúsið.com/productionlist/holub%C3%BAgvan2017/But when I copied the database to my test environment, the document's Url property is an absolute URL :
http://sjónleikarhúsið.com/productionlist/holub%C3%BAgvan2017/
Is there a configuration file somewhere where I can fix this?
(That the test page links to the production site, is a small problem. The big problem is that the strings returned have different structure. On the test server, I can use them to construct new Url objects, in production, that does not work.)
(Umbraco 7.1.8)
I found the solution for my problem. On my root document, the domain was set to the production production domain on both test and production sites, I changed that to the localhost in the test environment.
Find the root of the content, Actions > Culture and Hostnames.
I can also simply delete the domain name to get absolute paths. In my case, I should probably leave it blank in both environments, allowing me to test on a pure copy of the production database.
But it worries me that the format of the Url property can change between absolute path (
/home
), and absolute URL (http://example.com/home
). (If I use the Url property to construct an Url object, I'm in for a nasty surprise when the format changes to absolute path.)The rule seems to be that we get absolute path if we do not specify domain, or specify the domain we actually run on.
If we have specified another domain, we get an absolute URL.
is working on a reply...