I have a method that gets all the page versions of a page given the id. It then tries to obtain the HTML of each page version by using the GetHtmlFromPage() method in the PageCompareAlgorithm class.
However, sometimes the method returns the following:
<html><head><title>Object moved</title></head><body><h2>Object moved to <a href=\"%2fUtil%2flogin.aspx%3fReturnUrl%3d%252fen%252f\">here</a>.</h2></body></html>
This happens when the page status is Checked out for example, and seems to indicate some kind of access error (HTTP 302?).
So, my question is: why is this happening and how can I obtain the HTML?
Any help would be greatly appreciated!
As you can see you are redirected to the login page, which indicates (as you say) insufficient rights. This probably happens because
1) The page has not been published and therefore is not visible for anonymous users
2) The access to that page is restricted to logged in users.
Solution would be to impersonate a user that have read rights for both scenarios.
Thanks for your reply, seems like I have no other option than to impersonate a user.