Large Project in PHP using 404 Error-Redirections.
| From: | Maxim Maletsky | Date: | Mon, 16 Oct 2000 02:24:24 +0000 |
| Subject: | Large Project in PHP using 404 Error-Redirections. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-20289@lists.php.net to get a copy of this message | ||
Hello List,
Relying on all your great experience I am asking for an advice:
Is it OK to provocate 404-error and so redirect users to a PHP template in
order to create a _VERY_ large and portable website?
Here's our project:
It's a web-site. It HAS to be a Fully Database-Driven & "Sales-people"
administered.
It is crucial to have HTML, Databases and the Software Itself completely
Independent from each other. It also must be easy to install and things like
file managing, creating, uploading must have nothing to do with any FTP,
Telnet, fopen functions. All the content has to be in the database while
templates somewhere behind the root, plus one single file will ever exist to
connect the "website" to the "software" which then will connect to the
"database(s)".
I thought to do it in this way: having some kind of "virtual web site" where
only _one_ file (let's call it /index.php) exist and whatever else you would
request would provocate a 404 error which (though httpd.conf or .htaccess)
will redirect you to this file (/index.php). then /index.php would have one
single include of config file followed by a very basic html design - only
tables with site_header(), site_content(), and site_footer() functions in
it.
These three only functions are defined in config file. Then site_content()
(can already be called as "software") will work this way: first with explode
and regular expressions will parse the file name to know what database,table
to connect itself to and what fields to select, then pull out the data,
create virtual links, and so on...
I think the idea should work.
What all of you can advise to me, and most importantly what, if any, are
disadvantages of using the 404 error to start the software. Will a
browser/search engine/another non-authorized server know that the page
requested is an error page even if it has the right content in it?
If 404 is troublesome, how else can I redirect _any_ request to
_one_single_file_ which will then output you the data basing on $SCRIPT_NAME
and $REQUEST_URI pred. variables?
(We cannot use any variable passing via get / post methods except in few
cases)
NOTE: that the site might become _VERY_ large, and that's the reason of
having as dynamic and portable as posible (to be able to modify the design,
content, database types, split it between servers, etc..)
I appreciate your help, gurus!
:-))
Maxim Maletsky - maxim@j-door.com <mailto:maxim@j-door.com>
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109
http://www.j-door.com <http://www.j-door.com/>
http://www.japaninc.net <http://www.japaninc.net/>
http://www.lincmedia.co.jp <http://www.lincmedia.co.jp/>