Reply to default templates?

Your name:

Reply:


Posted by Josh Santangelo on 10/18/05 22:32

I'm working on a site that has a lot of dynamic content for which there
are PHP scripts and Smarty templates for each. Additionally, there is
lots of static content that does not need a separate PHP script for each.

Explaining the layout might help understand the problem:

/private/
/private/templates/
/private/templates/dynamicpage.tpl
/private/templates/staticpage.tpl
/public/ (the public web root)
/public/dynamicpage.php

So when a browser goes to http://host/dynamicpage.php, that script runs
and pulls in dynamicpage.tpl. What I'd like to do is be able to go to
http://host/staticpage.php and pull up staticpage.tpl without
staticpage.php actually existing.

This is because I don't want to create a ton of staticpage.php files for
each page of static content -- there would be hundreds of them in this
case, and would make for a maintenance nightmare.

I don't want to do something like
/staticpage.php?template=staticpage.tpl, because that's ugly and not
search-friendly.

I can't do /staticpage.php/staticpage.tpl, because PHP is running as CGI
and not as a module, and apparently that doesn't work.

I don't want to do some kind of trick with a custom 404 page, because
then the log will fill up with 404 errors.

I figure the answer must be some sort of mod_rewrite trick, which I
could sit around and figure out, or I could ask here because I'm sure
it's been done already. :)

-josh

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация