Wordpress Feed URL redirecting to Login Page

291 views Asked by At

I am trying to read wordpress feed url into php

This is link of Wordpress Feed URL

When we click on this url it redirects to login page where as it should have shown the contents of feed.

Below is my php code to read this feed url

<?php 

$xmlDoc = new DOMDocument();

libxml_use_internal_errors(true);
$xmlDoc->loadHTMLFile("https://intranet.saniservice.com/feed/rss2");
libxml_use_internal_errors(false);

print_r($xmlDoc);

?> 

When this code is executed it returns data but that data is of login page which we see when we click on feed url, I am not sure how can i stop this feed from redirecting to login page.

enter image description here

0

There are 0 answers