Page 1 of 1

Run Cron Job to Create PHP File

Posted: Mon Aug 22, 2011 12:53 pm
by unemployment
I want to create a dynamic sitemap.xml file for my site using php. I think the way I will need it to work is that i'll need to have a cron job create the file daily by pulling in the new urls from mysql. Any recommendation on how to go about doing this?


Update: I'm going to try this proposed solution instead. http://www.seopher.com/articles/writing ... sing_fopen

Re: Run Cron Job to Create PHP File

Posted: Tue Aug 23, 2011 11:16 am
by jacek
Why not just make the actual sitemap.xml file a php file ?

For this forum I created a sitemap.php and then used a RewiteRule to make it be served for requests for sitemap.xml

Re: Run Cron Job to Create PHP File

Posted: Tue Aug 23, 2011 12:21 pm
by unemployment
jacek wrote:Why not just make the actual sitemap.xml file a php file ?

For this forum I created a sitemap.php and then used a RewiteRule to make it be served for requests for sitemap.xml
Looks like I beat you to the punch. That's what I just did yesterday.