Also sprach Purple Haze:
The Apache web server can automatically transform a path into another using> I have seen websites that use a sort of "virtual directory" system...
> Lets say when you click on something it goes to
> Neither the scripts directory nor the php directory physically exisit
> on the server, does anyone know how this is done?
the Alias directive in its configuration files:
Alias /scripts/php c:/just/another/directory
So, when you type [url]http://www.example.com/scripts/php/[/url], Apache goes to
However, there is a much more flexible solution with Apache, it's called
mod_rewrite. This is an Apache module that allows you to transform
(re-write) URLs whichever way you wish, depending on the URL and the
RewriteRule ^scripts/php/(.*)$ /my/own/directory/myscript.php?page=$1
So, when you type [url]http://www.example.com/scripts/php/welcome.html[/url], the above
rule (to be placed either in the Apache's config file or an .htaccess file)
will transform this into
syntax of mod_rewrite uses regular expressions and is a bit complicated (I'm
not even sure if my above example will actually work, but it illustrates the
principle.) But it can be a very powerful tool.