virtual web folder served by PHP script

Posted by Martin on Server Fault See other posts from Server Fault or by Martin
Published on 2014-06-03T14:38:41Z Indexed on 2014/06/03 15:30 UTC
Read the original article Hit count: 230

Filed under:
|
|

I am trying to configure my apache to be able to display (virtual) pages like: mywebpage.com/something1 mywebpage.com/something2 mywebpage.com/folder/something3

I would like these "somethingX" and "folder" folders to be only virtual, not physical directories. For a start it would be great to send all requests to mywebpage to one PHP script which will somehow receive the original path information (there is some SERVER array as far as I know) and call necessary PHP functions (so far I use addresses like mywebpage.com/index.php?page=blabla&otherparameters=values...). Is that possible?

I am struggling with different combination, currently I am with following file in /etc/apache2/conf.d/something.conf (not working of course). What is the correct way to proceed? Thanks.

<Location /myweb>
SetHandler my-handler 
Action my-handler /srv/www/htdocs/myweb/product.php virtual
</Location>

My pages are in /srv/www/htdocs/myweb. I tried with Location, with Directory, with Action and SetHandler, with AddHandler... ;-) Some configurations were ignored, some caused "object not found" with nothing relevant in error log.

© Server Fault or respective owner

Related posts about php

Related posts about scripting