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
Run Cron Job to Create PHP File
Re: Run Cron Job to Create PHP File
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
For this forum I created a sitemap.php and then used a RewiteRule to make it be served for requests for sitemap.xml
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Run Cron Job to Create PHP File
Looks like I beat you to the punch. That's what I just did yesterday.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