virtual web folder served by PHP script
- by Martin
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.