- How to create a sitemap using PHP & MySQL
None of those questions really have a good answer to, 'How do I generate an XML sitemap in PHP?' Often they already know about online generators, but perhaps their site is not publicly accessible and they still need a sitemap. In any case, I feel it's been asked often enough that we could give a bit better solution than closing it as not a real question or closing it as a duplicate of something with really lousy solutions.
Update: I also noticed that there are honestly two questions that have been linked together as duplicates when they are not.
- How can I generate a sitemap in PHP?
- All my content is stored in a database, how can I generate a sitemap? (Oh, btw, I'm using PHP).
These are too very different questions when it comes to solutions, but they are linked as duplicates. The first requires a lot of code, using a crawler, HTML parser, URL resolver, a downloader. The second simply requires a bit of code to know how to generate the URL for each record in the database.
- Is it just too vague to answer on StackOverflow?
- Should we sort through the duplicate questions and properly link them base on whether content is stored in a database or not?
- Should I attempt to outline an algorithm for question 1? I've already started but I'm not sure if I should give more detail or not. I may be trying to help a lost cause.
- If I wrote a viable solution, which question would be the best place to post it as a solution?