PHP/MySQL to create Static HTML for SE

Discussion in 'PHP' started by jperezmt, Feb 13, 2008.

  1. #1
    I'm new at programming and I just want to know if this is even possible.

    I'd like to create a dynamic PHP website that produces Static Pages for Search Engines.

    For example if I create an article page that uses MySQL to store the data. When ever I post a new article, I'd like it to create a new static html page. This would populate the site with static pages full of content for search engines. But I would still be able to edit / delete / comment etc through a backend tool that changes values in the Table and the changes are reflected on each static page.

    Is it possible to do this? Hope it's not to confusing.
     
    jperezmt, Feb 13, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    It's possible, but I wouldn't make static pages. I'd make dynamic pages, and use mod_rewrite to make them seem static. This way it's way easier to edit the pages.

    So instead of calling the page this way:
    /page.php?article=how-to-do-this-and-that

    You use mod_rewrite to make the page accessible like this:
    /article/how-to-do-this-and-that.html
     
    nico_swd, Feb 13, 2008 IP
  3. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #3
    You would be better off to keep the data static and use mod rewrite to produce SEO friendly urls. What you asked for is possible but it would require updating the static pages each time the data changed. Can be scripted but why go through the extra effort? A quick google search for "SEO friendly urls mod rewrite" should turn up plenty of instructions.
     
    shallowink, Feb 13, 2008 IP
  4. jperezmt

    jperezmt Peon

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    but if you have let's say 25 articles on your site through the mySQL Database, and you use mod rewrite, will the search engines be able to spider through each individual article for relevant content?
     
    jperezmt, Feb 13, 2008 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    Yes, if you code it correctly. The site will seem static, (like an HTML page), but in reality it's pure PHP.
     
    nico_swd, Feb 13, 2008 IP
  6. jnestor

    jnestor Peon

    Messages:
    133
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    There's also much less of a search engine penalty for using dynamic pages than there was years ago. Google can easily spider pages like article.php?id=123. What you want avoid is session ids in urls. Anything that would make the urls appear different each time. As long as your urls are permanent I wouldn't worry too much.

    Still it's easy enough to use mod-rewrite to make better looking urls so it's probably worth it. Just make sure you output the urls in the same way in every part of your site.
     
    jnestor, Feb 13, 2008 IP