..
1. Apache module mod_alias
The mod_alias in Apache is a module referenced by the directives, which define the alternatives in the type of URL (translation), in practice it will be possible to reach a particular Web page or other resource by different typing in the address bar, for this same reason, the mod_alias can also be used for operations of URL redirects.
Let's take an example, we know that the Apache directives must be written to the container specified in the configuration file httpd.conf and intended to provide instructions for operating the Web server.
In the next box instructions show an example of a fairly common containers:
<VirtualHost *> ServerName www.centre-equestre-lepuy.com ServerAlias centre-equestre-lepuy.com # ... Other directives </ VirtualHost>In the code we have proposed two directives: ServerName, which indicates the real name of the Host of our website and ServerAlias that can be passed as parameters to the various aliases of the original, it follows that the site indicated in the container can be achieved either entering a full address ("www.centre-equestre-lepuy.com") and its alias ("centre-equestre-lepuy.com").
ServerAlias, as anticipated, accepts multiple parameters, to be active, just type them one after the other separated by a space:
ServerAlias centre-equestre-lepuy.com sito.centre-equestre-lepuy.com mrwebmasterThe Alias directive called simply retrieves files that are also located externally from the Web server document root (the one that hosts the Web site). This directive takes two parameters: the URL to be translated, that is the path to the resource requested by the client's input, the actual path to the file system where the resource is required.
For example:
Alias / icons / usr / local / apache / iconsIn this case, all requests sent to the URL "http://www.nome_sito.it/icons" from the Web server will look in the directory "/ usr / local / apache / icons" that can be placed in a location outside the Document Root.
The Directive AliasMatch other hand, offers a few more tools to the administrator of the Web server, it is possible to associate to it the regular expressions containing parameters. Here's an example:
AliasMatch / Christmas /(.*) \. Jpg $ / images / holidays / christmas / $ 1.jpgIn this second case, all requests from the client to file. "Jpg" in the folder "/ Christmas /" are searched from the Web server in the folder "/ images / holidays / Christmas /".
| |
Linux (Course)
Complete guide to open-source system. From 49 €. |
| |
MySQL (Course)
Management of open-source database. From 39 €. |
| |
PHP (Course)
Full course for creating dynamic Web sites. From 49 €. |