..
1. Introduction to Apache mod_rewrite
The mod_rewrite Apache modules is one of the most widely used among those available for this Web server, in particular the fact of making available a tool that allows Webmasters to be a part of creating Web sites based on dynamic web based applications and on the other make the pages produced by the application "digestible" for the search engines.
But what is the function of this module? In practice the mod_rewrite allows you to "translate" a URL in another user-defined according to certain rules which must be written within the Apache configuration file or inside a separate file, called. Htaccess file, which will be uploaded to 'inside of the root of our web site (even the' upload this file must be conducted according to certain criteria, but will deepen this discussion in a moment).
A classic case of use of mod_rewrite is related to the translation of URLs into static dynamics, mind you that this concept is crucial, because the form is not meant to make dynamic address (containing querystring) as static, but rather the opposite! The search engine and our users will see a static URL (pippo.html), but in reality the resource exists in a dynamic address (pagina.php? Id = foo).
To do this we will write our rule in the translation. Htaccess file and upload it to the desired location (ie one for which the rewrite rules apply), and from that moment on, the pages involved the following steps will occur for our Web Server:
But why hide a URL? Nowadays the reasons must be sought in factors that often do not relate to matters closely related technical or application development.
Initially the mod_rewrite was created to address the problem of the URL is too long to type, it happened (and often still happens) that to achieve detrminata resource type were overflowing with querystring variables and parameters; rewrite eliminates this problem by the ability of clients to provide more user friendly URL.
Today, instead of rewriting has become a very important topic for operations with the positioning of websites in search engines.
And 'well known fact that they do not index pages efficiently reached by querystring too long or too rich in parameters, this factor may limit the ability of the placement of a resource within the SERPs.
In practice we can say that what is user friendly for users it is for search engines.
| |
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 €. |