Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1 file, multiple urls, maybe apache rewrite?

Status
Not open for further replies.

ThomasJSmart

Programmer
Sep 16, 2002
634
Hi,

Im looking to do a little thing, im not sure what its called or how to do it and im not sure what to look for to find a solution :/

This is what i would like:

I have a php website, with all content in databases, a design template and several modules for different content. This is all finished and working lovely.

Now to have the website usable for the end-user there are different html pages, these are only very basic pages with a header, page specific title/keys/descr (loaded from db). and then an include for the layout and such.

currently i have to copy this html file several times giving each one a different name, the php code gets the filename and loads all the apropriate settings and content from the database.

Now i was thinking... wouldnt it be nice to have only 1 html file, say an index.html. but that the user can still enter (and i can have links for) all the pages in the website???

so and can both be entered or linked to, and this is what the user sees (and stays seeing) in the address field, however the content is loaded from 1 single file on the server, saving me a lot of copy-pasting or html file generation. ofcourse php would still also have to recognise the different urls as i use the page name to get content from the database. and possible some fallback should a page not exist i can handle in php.

is this even possible????


Thomas

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
symbolic links?

mod_rewrite can also do the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top