Como redireccionar urls con Apache
Sacado de http://library.linode.com/web-servers/apache/configuration/redirecting-urls
Gracias al plug
Redirect URLs with the Apache Web ServerWhen HTTP resources, or web pages, change locations it is often important to provide some means of alerting users that these resources have moved. HTTP provides a number of "redirection" codes that can be used to facilitate this process, by communicating with he client application without interfering on the users experience.
Apache provides a number of "redirect" configuration directives that allow administrators to specify resources in the configuration file to redirect to another URL. When a request is redirected the server returns a result for that request that instructs the client to initiate a second request for the target resource's new location.
Redirections can tell the client that the requested page has been moved temporarily or permanently. Apache provides tools to easily support these functions. This guide covers the Redirect configuration directive, explains how to set various redirect options, and shows how to redirect classes of requests for resources to new locations.
This guide assumes you have a working installation of Apache and have access to modify configuration files. If you have not installed Apache, you might want to use one of our Apache installation guides or LAMP stack installaiton guides to get up and running first. If you want a more thorough introduction to Apache configuration, consider our basic Apache configuration and Apache configuration structure documents.
Redirect /squire http://team.ducklington.org/~squire/
Remember that no matter what configuration file they are located in, Redirect statements must specify the full path of the redirected resource following the domain name. These statements must also include the full URL of the resource's new location..
To specify a particular HTTP redirection status, specify one of the following status:
Redirect permanent /squire http://team.ducklington.org/~squire/ Redirect temp /squire http://team.ducklington.org/~squire/ Redirect seeother /squire http://team.ducklington.org/~squire/ Redirect gone /squire
You can also specify specific HTTP codes, as follows.
Redirect 301 /squire http://team.ducklington.org/~squire/ Redirect 302 /squire http://team.ducklington.org/~squire/ Redirect 303 /squire http://team.ducklington.org/~squire/ Redirect 410 /squire
RedirectPermanent /squire/bio.html http://team.ducklington.org/~squire/bio/ RedirectTemp /squire/bio.html http://team.ducklington.org/~squire/bio/
RedirectMatch (.*)\.jpg$ http://static.ducklington.org$1.jpg
- A request for http://www.ducklington.org/avatar.jpg will be redirected to http://static.ducklington.org/avatar.jpg and
- A request for http://www.ducklington.org/images/avatar.jpg will be redirected to http://static.ducklington.org/images/avatar.jpg.
The Linode Library contains an introduction to rewriting URLs with mod_rewrite and Apache, which you might find useful.