How to print an xml file to the screen in php?
This is not working:
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, \'http://rss.news.y
The best solution is to add to your apache .htaccess
file the following line after RewriteEngine On
RewriteRule ^sitemap\.xml$ sitemap.php [L]
and then simply having a file sitemap.php
in your root folder that would be normally accessible via http://www.yoursite.com/sitemap.xml
, the default URL where all search engines will firstly search.
The file sitemap.php
shall start with
';
?>
https://www.yoursite.com/
2020-01-08T13:06:14+00:00
1.00
it works :)