Link validation works as expected in local and integration environment and reports broken links in link status report. But if we run this in pre-production and production environment link validation tool fails and errors out as "This operation is not supported for a relative uri".
Specify whether the link validation function is active/inactive and how often the job should be run. The link validation job validates the status of all links in the website content.
Can you please help with this behaviour of Link validation tool? What is the possible fix for this issue?
From what I can see, this occurs if you include a relative URL (e.g. a URL starting with a /) in the content of one of your pages. To resolve the issue I think you'd need to fix that URL so that it points to a page in Episerver. If you need to find out where that URL is, you can run a query against the SoftLink table in the Episerver database as follows:
SELECT TOP (1000) *
where LinkUrl like '/%'
Thank you for query which helped us to get the list of relative uri from our live database. Can you please guide us on how can we correct the relative links for some content items?
please find few relative uri from database:
I suspect the issue will be with the external links which have a link type of 2 so the original query could be updated like this:
SELECT TOP (1000) *
where LinkUrl like '/%' and LinkType = 2
In your example above, this would leave the /ireland/careers/get-started/ URL as the problem URL. Assuming there's not too many records with a link type of 2, the easiest method would be to modify the content manually to fix the issue. The fkOwnerContentID field gives the ID of the page so, assuming your CMS is in the default location, you can jump directly to that page in the CMS editor by going to:
where 18999 is the ID of the content item you need to edit. You can then find the link in question and update it to be a reference to a page.
Thank you so much with help regarding relative URI issue for link validation. Now we are facing issue with mailto: link with one of the page. Can you please help us tracing the particular page with mailto: link which is not correctly used or is this is issue with all of the pages with mailto: link?
Link validation fails with this error "The scheme for the url "mailto:firstname.lastname@example.org?subject=Purchasing Management" in not http or https."
You can get the record in question by running a SQL command like the following:
WHERE LinkUrl = 'mailto:email@example.com?subject=Purchasing Management'
It looks like the issue is with the LinkProtocol field in the database. For a mailto link this should have the value 'mailto' but, if I use that mailto link, the LinkProtocol is 'NULL'. This appears to be due to the space in the subject. Removing the space seems to resolve the issue for me though that may not be practical in your situation.