some kind of redirection (not the header function)
| From: | Juan Nin | Date: | Thu, 11 Sep 2003 18:34:50 +0000 |
| Subject: | some kind of redirection (not the header function) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-162322@lists.php.net to get a copy of this message | ||
Hi!!!
I´m programming a site in PHP, where I want to do the following:
I will have a set of different directories, where each directory must
execute the same PHP pages, but giving as result different data,
according to the directory where you are located (obtained by
$_SERVER[´PHP_SELF´] for example).
For example I have:
http://www.domain.com/directoryA/
http://www.doamin.com/directoryB/
So each one must have (or should act as if they had) the same PHP pages
and directories under them.
The solution I thought, as copying each page in every directory makes no
sense (if I modify the code I´ll have to change all the pages in all
directories), is to have an includes directory. where I put all the PHP
pages, and in each of the different directories I create pages that
simply include or require the ones from the include directories.
That way I´ll only modify code inone place..
Now.. is there any better way to achieve this??
I thought that maybe with some Apache stuff, but I don´t think thereś
something that will help, since directives such as RedirectMatch, etc.
rewrite the URL, and I don´t want that, I want the URL to remain
http://www.domain.com/directoryX/whatever.php
Is there any way to do this, or I should stick up with the includes??
Thnx in advance,
Juan