views:

26

answers:

2

I have apache setup to wildcard direct all unknown trafic to one php script (default documentroot). This php script looks into a database and possibly finds the correct documentroot for the requested domain (or documetroot of the 404 error handler etc..).

The problem is, that from within php script I know how to include another script, but can not change the documentroot - ie. force apache to set the found documentroot for the request, read htaccess file, run scripts etc.. can I? Any other solution? Must be allready somehow solved and solution is probably not very difficult, but was not able to create a fully working setup so far..:-( thanks

+3  A: 

You can send the Location header to the browser to force it to redirect to another URL.

Ignacio Vazquez-Abrams
header('Location: http//new.url.com');
thetaiko
sending header location would change the url - i am looking for a solution on the server side only - without redirecting the user..
You can't force httpd to process changes to the URL without changing the URL.
Ignacio Vazquez-Abrams
+1  A: 

Hi,

Maybe you should redirect this traffic wherever you want by using Location:

Header("Location: /this-new-page/");

You can check the php manual at the Header page.

Patrick MARIE