Jump to content

How to generate HTML file from PHP code


never_rain

Recommended Posts

Hi,

I am developing an article based website. I want each article to be indexed in search engines. My URL becomes like this.

http://www.pbm-biz.com/wow/articleDetails.php?id=3&&title=Human Psychology

I want this page to be saved in this way.

http://www.pbm-biz.com/wow/HumanPsychology.html

My first Question is, Is this the right approach ?
If yes, How to generate the HTML file with each article. Any link to knowledge base is welcome or personal experience is also appreciated.

If this is not the right approach, what is the best thing to do.

I really appreciate your help and anxiously waiting for your reply.

Regards,

Faisal


Link to comment
Share on other sites

Last I remembered.. search engines do index pages that are generated via databases.  Though I do understand that actual .html files would be easier for it to be crawled.

I think it's fwrite() you want to look at if you're wanting to create the actual .html file. Just output the code to variables and then write those to the file.

I do know there have been people to do what you want.  I just can't remember where/how they did it, but I know it can be done. You have to parse the URL for the file you wish to serve.  Where mydomain.com/article/ThisThing101/1 usually meant something like mydomain.com/article.php?name=ThisThing101&page=1

Sorry I could not be any more help.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.