Run Cron Job to Create PHP File

Ask about a PHP problem here.
Post Reply
unemployment
Posts: 165
Joined: Fri May 06, 2011 5:02 pm

Run Cron Job to Create PHP File

Post 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
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Run Cron Job to Create PHP File

Post 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
Image
unemployment
Posts: 165
Joined: Fri May 06, 2011 5:02 pm

Re: Run Cron Job to Create PHP File

Post 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.
Post Reply