Automating the creation and naming of webpages

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
stubarny
Forum Newbie
Posts: 10
Joined: Thu Jul 27, 2006 12:53 pm

Automating the creation and naming of webpages

Post by stubarny »

Hi eveyone,

I have a website with lots of factfiles - all have the same structure. The only difference is the text contained within each field of the factfiles.

At the moment each factfile is hosted at "www.websitename.com/factfile.php?factfi ... 3421648452", where factfile_id tells factfile.php what content should be displayed.

To improve the pages' positions in search engines I'd like to change the webaddress to "www.websitename.com/FACTFILE_NAME"

So my questions are:

1. How do I make all the factfiles work from a single uploaded file? (there are over 400 factfiles and at present all factfiles run from "factfile.php")

2. When a user submits data via a webform to create a new factfile (this creates a new row in my database table) how can I automatically create a new webpage? - I don't want to be uploading a new file everytime a new factfile is setup.

Thanks for your help!

Regards,

Stubarny
User avatar
LanceEh
Forum Commoner
Posts: 46
Joined: Tue Feb 17, 2009 11:53 am
Location: Florida

Re: Automating the creation and naming of webpages

Post by LanceEh »

What you are looking for is mod_rewrites. It will probably take you a couple days to a week to learn depending on how fast you go.

Note: You don't have to upload a new page everytime, nothing will change in your code, it should all run the same as before.

If you get stuck, let me know and I'll write the code for you.

Take care.
Post Reply