jueves, 5 de noviembre de 2009

URL redirection

URL redirectionOneRiotYahooAmazonTwitterdel.icio.us

From Wikipedia, the free encyclopedia



URL redirection, also called URL forwarding and the very similar technique domain redirection also called domain forwarding, are techniques on the World Wide Web for making a web page available under many URLs.

Contents


[edit] Purposes

There are several reasons to use URL redirection:

[edit] Similar domain names

A web browser user might mis-type a URL—for example, "exampel.com" and "exmaple.com". Organizations often register these "mis-spelled" domains and re-direct them to the "correct" location: example.com. For example: the addresses example.com and example.net could both redirect to a single domain, or web page, such as example.org. This technique is often used to "reserve" other TLDs with the same name, or make it easier for a true ".edu" or ".net" to redirect to a more recognizable ".com" domain.

[edit] Moving a site to a new domain

A web page may be redirected for several reasons:

  • A web site might need to change its domain name.
  • An author might move his or her pages to a new domain.
  • Two web sites might merge.

With URL redirects, incoming links to an outdated URL can be sent to the correct location. These links might be from other sites that have not realized that there is a change or from bookmarks/favorites that users have saved in their browsers.

The same applies to search engines. They often have the older/outdated domain names and links in their database and will send search users to these old URLs. By using a "moved permanently" redirect to the new URL, visitors will still end at the correct page. Also, in the next search engine pass, the search engine should detect and use the newer URL.

[edit] Logging outgoing links

The access logs of most web servers keep detailed information about where visitors came from and how they browsed the hosted site. They do not, however, log which links visitors left by. This is because the visitor's browser has no need to communicate with the original server when the visitor clicks on an outgoing link.

This information can be captured in several ways. One way involves URL redirection. Instead of sending the visitor straight to the other site, links on the site can direct to a URL on the original website's domain that automatically redirects to the real target. This technique bears the downside of the delay caused by the additional request to the original website's server. As this added request will leave a trace in the server log, revealing exactly which link was followed, it can also be a privacy issue.[1]

The same technique is also used by some corporate websites to implement a statement that the subsequent content is at another site, and therefore not necessarily affiliated with the corporation. In such scenarios, displaying the warning causes an additional delay.

[edit] Short aliases for long URLs

Web applications often include lengthy descriptive attributes in their URLs which represent data hierarchies, command structures, transaction paths and session information. This practice results in a URL that is aesthetically unpleasant and difficult to remember, and which may not fit within the size limitations of microblogging sites. URL shortening services provide a solution to this problem by redirecting a user from a longer URL to a shorter one.

[edit] Meaningful, persistent aliases for long or changing URLs

Sometimes the URL of a page changes even though the content stays the same. Therefore URL redirection can help users who have bookmarks. This is routinely done on Wikipedia whenever a page is renamed.

[edit] Manipulating search engines

Some years ago, redirect techniques were used to fool search engines. For example, one page could show popular search terms to search engines but redirect the visitors to a different target page. There are also cases where redirects have been used to "steal" the page rank of one popular page and use it for a different page, usually involving the 302 HTTP status code of "moved temporarily." [2][3]

Search engine providers noticed the problem and took appropriate actions[citation needed]. Usually, sites that employ such techniques to manipulate search engines are punished automatically by reducing their ranking or by excluding them from the search index.

As a result, today, such manipulations usually result in less rather than more site exposure.

[edit] Satire and criticism

In the same way that a Google bomb can be used for satire and political criticism, a domain name that conveys one meaning can be redirected to any other web page, sometimes with malicious intent.

[edit] Manipulating visitors

URL redirection is sometimes used as a part of phishing attacks that confuse visitors about which web site they are visiting. However, because modern browsers always show the real URL in the address bar, the threat is lessened. However, redirects can also take you to sites that will otherwise attempt to attack in other ways. For example, a redirect might take a user to a site that would attempt to trick them into downloading antivirus software and ironically installing a trojan of some sort instead.

[edit] Techniques

There are several techniques to implement a redirect. In many cases, Refresh meta tag is the simplest one. However, there exist several strong opinions discouraging this method.[citation needed]

[edit] Manual redirect

The simplest technique is to ask the visitor to follow a link to the new page, usually using an HTML anchor as such:

Please follow <a href="http://www.example.com/">link</a>!

This method is often used as a fall-back for automatic methods — if the visitor's browser does not support the automatic redirect method, the visitor can still reach the target document by following the link.

[edit] HTTP status codes 3xx

In the HTTP protocol used by the World Wide Web, a redirect is a response with a status code beginning with 3 that induces a browser to go to another location.

The HTTP standard defines several status codes for redirection:

  • 300 multiple choices (e.g. offer different languages)
  • 301 moved permanently
  • 302 found (originally temporary redirect, but now commonly used to specify redirection for unspecified reason)
  • 303 see other (e.g. for results of cgi-scripts)
  • 307 temporary redirect

All of these status codes require that the URL of the redirect target be given in the Location: header of the HTTP response. The 300 multiple choices will usually list all choices in the body of the message and show the default choice in the Location: header.

Within the 3xx range, there are also some status codes that are quite different from the above redirects (they are not discussed here with their details):

  • 304 not modified
  • 305 use proxy

This is a sample of an HTTP response that uses the 301 "moved permanently" redirect:

HTTP/1.1 301 Moved Permanently

Location: http://www.example.org/
Content-Type: text/html
Content-Length: 174

<html>
<head>
<title>Moved</title>
</head>
<body>
<h1>Moved</h1>
<p>This page has moved to <a href="http://www.example.org/">http://www.example.org/</a>.</p>
</body>
</html>

[edit] Using server-side scripting for redirection

Often, web authors don't have sufficient permissions to produce these status codes: The HTTP header is generated by the web server program and not read from the file for that URL. Even for CGI scripts, the web server usually generates the status code automatically and allows custom headers to be added by the script. To produce HTTP status codes with cgi-scripts, one needs to enable non-parsed-headers.

Sometimes, it is sufficient to print the "Location: 'url'" header line from a normal CGI script. Many web servers choose one of the 3xx status codes for such replies.

Frameworks for server-side content generation typically require that HTTP headers be generated before response data. As a result, the web programmer who is using such a scripting language to redirect the user's browser to another page must ensure that the redirect is the first or only part of the response. In the ASP scripting language, this can also be accomplished using the methods response.buffer=true and response.redirect "http://www.example.com". Using PHP, one can use header("Location: http://www.example.com");.

According to the HTTP protocol, the Location header must contain an absolute URI[4]. When redirecting from one page to another within the same site, it is a common mistake to use a relative URI. As a result most browsers tolerate relative URIs in the Location header, but some browsers display a warning to the end user.

[edit] Using .htaccess for redirection

When using the Apache web server, directory-specific .htaccess files (as well as apache's main configuration files) can be used. For example, to redirect a single page:

Redirect ^oldpage.html http://www.example.com/newpage.html [R=301,L]

To change domain names using example.com/.htaccess or within a section in an Apache config file:

RewriteEngine on


RewriteCond %{HTTP_HOST} ^([^.:]+\.)*oldwebsite\.com\.?(:[0-9]*)?$ [NC]
RewriteRule ^(.*)$ http://www.preferredwebsite.net/$1 [R=301,L]

Use of .htaccess for this purpose usually does not require administrative permissions. However, .htaccess can be disabled by your host, and so may not work (or continue to work) if they do so.

In addition, some server configurations may require the addition of the line:

Options +FollowSymLinks

ahead of the "RewriteEngine on" directive, in order to enable the mod_rewrite module.

When you have access to the main apache config files (such as httpd.conf), it is best to avoid the use of .htaccess files.

If the code is placed into an Apache config file and not within any container, then the RewriteRule pattern must be changed to include a leading slash:

RewriteEngine on


RewriteCond %{HTTP_HOST} ^([^.:]+\.)*oldwebsite\.com\.?(:[0-9]*)?$ [NC]
RewriteRule ^/(.*)$ http://www.preferredwebsite.net/$1 [R=301,L]

[edit] Refresh Meta tag and HTTP refresh header

Netscape introduced a feature to refresh the displayed page after a certain amount of time. This method is often called meta refresh. It is possible to specify the URL of the new page, thus replacing one page after some time by another page:

A timeout of 0 seconds means an immediate redirect. Meta Refresh with a timeout of 0 seconds is accepted as an 301 permanent redirect by Google, allowing to transfer PageRank from static html files. [5]

This is an example of a simple HTML document that uses this technique:

<html><head>

<meta http-equiv="Refresh" content="0; url=http://www.example.com/">
</head><body>
<p>Please follow <a href="http://www.example.com/">link</a>!</p>
</body></html>
  • This technique is usable by all web authors because the meta tag is contained inside the document itself.
  • The meta tag must be placed in the "head" section of the HTML file.
  • The number "0" in this example may be replaced by another number to achieve a delay of that many seconds.
  • This is a proprietary extension to HTML introduced by Netscape but supported by most web browsers. The manual link in the "body" section is for users whose browsers do not support this feature.

This is an example of achieving the same effect by issuing an HTTP refresh header:

HTTP/1.1 200 ok

Refresh: 0; url=http://www.example.com/
Content-type: text/html
Content-length: 78

Please follow <a href="http://www.example.com/">link</a>!

This response is easier to generate by CGI programs because one does not need to change the default status code. Here is a simple CGI program that effects this redirect:

#!/usr/bin/perl

print "Refresh: 0; url=http://www.example.com/\r\n";
print "Content-type: text/html\r\n";
print "\r\n";
print "Please follow \"http://www.example.com/\">link!"

Note: Usually, the HTTP server adds the status line and the Content-length header automatically.

This method is considered by the W3C to be a poor method of redirection, since it does not communicate any information about either the original or new resource, to the browser (or search engine). The W3C's Web Content Accessibility Guidelines (7.4) discourage the creation of auto-refreshing pages, since most web browsers do not allow the user to disable or control the refresh rate. Some articles that they have written on the issue include W3C Web Content Accessibility Guidelines (1.0): Ensure user control of time-sensitive content changes and Use standard redirects: don't break the back button!

[edit] JavaScript redirects

JavaScript offers several ways to display a different page in the current browser window. Quite frequently, they are used for a redirect. However, there are several reasons to prefer HTTP header or the refresh meta tag (whenever it is possible) over JavaScript redirects:

  • Security considerations
  • Some browsers don't support JavaScript
  • many web crawlers don't execute JavaScript.

[edit] Frame redirects

A slightly different effect can be achieved by creating a single HTML frame that contains the target page:

<frameset rows="100%">

<frame src="http://www.example.com/">
</frameset>
<noframes>
<body>Please follow <a href="http://www.example.com/">link</a>!</body>
</noframes>

One main difference to the above redirect methods is that for a frame redirect, the browser displays the URL of the frame document and not the URL of the target page in the URL bar.

This technique is commonly called cloaking. This may be used so that the reader sees a more memorable URL or, with fraudulent intentions, to conceal a phishing site as part of website spoofing.[6]

[edit] Redirect loops

It is quite possible that one redirect leads to another redirect. For example, the URL http://www.wikipedia.com/wiki/URL_redirection (note the differences in the domain name) is first redirected to http://www.wikipedia.org/wiki/URL_redirection and again redirected to the correct URL: http://en.wikipedia.org/wiki/URL_redirection. This is appropriate: the first redirection corrects the wrong domain name, the second redirection selects the correct language section, and finally, the browser displays the correct page.

Sometimes, however, a mistake can cause the redirection to point back to the first page, leading to an infinite loop of redirects. Browsers usually break that loop after a few steps and display an error message instead.

The HTTP standard states:

A client SHOULD detect infinite redirection loops, since such loops generate network traffic for each redirection.

Previous versions of this specification recommended a maximum of five redirections; some clients may exist that implement such a fixed limitation.

[edit] Services

There exist services that can perform URL redirection on demand, with no need for technical work or access to the webserver your site is hosted on.

[edit] URL redirection services

A redirect service is an information management system, which provides an internet link that redirects users to the desired content. The typical benefit to the user is the use of a memorable domain name, and a reduction in the length of the URL or web address. A redirecting link can also be used as a permanent address for content that frequently changes hosts, similarly to the Domain Name System.

Hyperlinks involving URL redirection services are frequently used in spam messages directed at blogs and wikis. Thus, one way to reduce spam is to reject all edits and comments containing hyperlinks to known URL redirection services; however, this will also remove legitimate edits and comments and may not be an effective method to reduce spam.

Recently, URL redirection services have taken to using AJAX as an efficient, user friendly method for creating shortened URLs.

A major drawback of some URL redirection services is the use of delay pages, or frame based advertising, to generate revenue.

[edit] History

The first redirect services took advantage of top-level domains (TLD) such as ".to" (Tonga), ".at" (Austria) and ".is" (Iceland). Their goal was to make memorable URLs. The first mainstream redirect service was V3.com that boasted 4 million users at its peak in 2000. V3.com success was attributed to having a wide variety of short memorable domains including "r.im", "go.to", "i.am", "come.to" and "start.at". V3.com was acquired by FortuneCity.com, a large free web hosting company, in early 1999. In 2001 emerged .tk (Tokelau) as a TLD used for memorable names.[7] As the sales price of top level domains started falling from $70.00 per year to less than $10.00, the demand for memorable redirection services eroded.[citation needed]

With the launch of TinyURL on 2002 new kind of redirecting services was born, namely URL shortening. Their goal was to make long URLs short, to be able to post them on internet forums. Since 2006, with the 140 character limit on the extremely popular Twitter service, these short URL services have seen a resurgence.

[edit] URL obfuscation services

There exist redirection services for hiding the referrer using META refresh, such as Anonymity.com and Anonym.to.

This is very easy to do with PHP, such as in this example.



/* This code is placed into the public domain */
/* Will redirect a URL */

$url = htmlspecialchars($_GET['url']);
?>

Redirect
echo $url; ?>">

You should be able to be redirected to echo $url; ?>"> echo $url; ?>.

This code can then be accessed by example,

http://example.org/redirect.php?url=http://www.google.com

The above example code may not work correctly with URLs containing variables, unless the input is first encoded, or code is added that loops across the $_GETs and pieces together the final URL.

[edit] See also

[edit] References

  1. ^ "Google revives redirect snoopery". blog.anta.net. 2009-01-29. ISSN 1797-1993. http://blog.anta.net/2009/01/29/509/. Retrieved 2009-01-30.
  2. ^ Google's serious hijack problem
  3. ^ Stop 302 Redirects and Scrapers from Hijacking Web Page PR - Page Rank
  4. ^ R. Fielding, et al., Request for Comments: 2616, Hypertext Transfer Protocol — HTTP/1.1, published 1999-07, §14.30 "Location", fetched 2008-10-07
  5. ^ Google and Yahoo accept undelayed meta refreshs as 301 redirects, 3 September, 2007, http://sebastians-pamphlets.com/google-and-yahoo-treat-undelayed-meta-refresh-as-301-redirect/
  6. ^ Anti-Phishing Technology", Aaron Emigh, Radix Labs, 19 January 2005
  7. ^ http://news.bbc.co.uk/2/hi/technology/6991719.stm

[edit] External links

Categories: Spamming | URL | Black hat search engine optimization | Information retrieval | Internet terminology


Cambio de dirección del URL

De Wikipedia, la enciclopedia libre

El cambio de dirección del URL, también llamado expedición del URL y el cambio de dirección muy similar del dominio de la técnica también llamó la expedición del dominio, es técnicas en el World Wide Web para hacer un Web page inferior disponible muchos URL.

Contenido



[corrija] los propósitos

Hay varias razones para utilizar el cambio de dirección del URL:

[corrija] los Domain Name similares

Un usuario del web browser pudo el mis-tipo a URL-para el ejemplo, “exampel.com” y “example.com”. Las organizaciones colocan éstos los dominios “deletreados mal” y los vuelven a dirigir a menudo a “corrigen” la localización: example.com. Por ejemplo: las direcciones example.com y example.net podían ambas volver a dirigir a un solo dominio, o Web page, tal como example.org. Esta técnica es de uso frecuente “reservar” el otro TLDs con el mismo nombre, o haga más fácil para un verdad” .edu " o “.net” para volver a dirigir a un dominio más reconocible de” .com ".

[corrija] moviendo un sitio a un nuevo dominio

Un Web page se puede volver a dirigir por varias razones:

  • Un Web site pudo necesitar cambiar su Domain Name.
  • Un autor pudo mover sus páginas a un nuevo dominio.
  • Dos Web site pudieron combinarse.

Con el URL vuelve a dirigir, los acoplamientos entrantes a un URL anticuado puede ser enviado a la localización correcta. Estos acoplamientos pudieron ser de otros sitios que no han realizado que hay un cambio o de las señales/de los favoritos que los usuarios han ahorrado en sus hojeadores.

Igual se aplica a los motores de la búsqueda. Tienen los más viejos/anticuados Domain Name y acoplamientos en su base de datos y enviarán a menudo a usuarios de la búsqueda a estos URL viejos. Usando “movido permanentemente” vuelva a dirigir al nuevo URL, visitantes todavía terminará en la página correcta. También, en el paso siguiente del Search Engine, el Search Engine debe detectar y utilizar el URL más nuevo.

[corrija] los acoplamientos salientes de registración

Los registros del acceso de la mayoría de los web server guardan la información detallada sobre de donde los visitantes vinieron y de cómo hojearon el sitio recibido. , Sin embargo, no registran que liga a los visitantes dejados cerca. Esto es porque el hojeador del visitante no tiene ninguna necesidad de comunicar con el servidor original cuando el visitante chasca encendido un acoplamiento saliente.

Esta información se puede capturar de varias maneras. Una forma implica el cambio de dirección del URL. En vez de enviar al visitante derecho al otro sitio, los acoplamientos en el sitio pueden dirigir a un URL en el dominio del Web site original que vuelve a dirigir automáticamente a la blanco verdadera. Esta técnica lleva la desventaja del retardo causado por la petición adicional al servidor del Web site original. Pues esta petición agregada dejará un rastro en el registro del servidor, revelando exactamente que el acoplamiento fue seguido, puede también ser una edición de la aislamiento. [1]

La misma técnica también es utilizada por algunos Web site corporativos para ejecutar una declaración que el contenido subsecuente está en otro sitio, y por lo tanto afiliada no no necesariamente con la corporación. En tales panoramas, la exhibición de la advertencia causa un retardo adicional.

[corrija] los alias cortos para los URL largos

Las aplicaciones web incluyen a menudo cualidades descriptivas muy largas en sus URL que representen jerarquías de datos, las estructuras de comando, las trayectorias de la transacción y la información de sesión. Esta práctica da lugar a un URL que sea estético desagradable y difícil de recordar, y que puede no caber dentro de las limitaciones del tamaño de microblogging localiza. Los servicios del acortamiento del URL proporcionan una solución a este problema volviendo a dirigir a un usuario de un URL más largo más corto.

[corrija] los alias significativos, persistentes para de largo o los URL cambiantes

El URL de una página cambia a veces aunque el contenido permanece iguales. Por lo tanto el cambio de dirección del URL puede ayudar a los usuarios que tienen señales. Esto se hace rutinario en Wikipedia siempre que se retitule una página.

[corrija] los motores de manipulación de la búsqueda

Hace algunos años, vuelva a dirigir las técnicas fueron utilizados para engañar los motores de la búsqueda. Por ejemplo, una página podía demostrar términos populares de la búsqueda a los motores de la búsqueda sino volver a dirigir a los visitantes a una diversa página de la blanco. Hay también los casos donde vuelve a dirigir se han utilizado “roban” la fila de la página de una página popular y la utiliza para una diversa página, generalmente implicando el código de estado del HTTP 302 de “movido temporalmente.” [2] [3]

Los abastecedores del Search Engine notaron el problema y tomaron medidas apropiadas [citación necesaria]. Generalmente, los sitios que emplean tales técnicas para manipular los motores de la búsqueda son castigados automáticamente reduciendo su graduación o excluyéndolos del índice de la búsqueda.

Consecuentemente, hoy, tales manipulaciones dan lugar generalmente menos algo que más exposición del sitio.

[corrija] sátira y las críticas

De la misma manera que una bomba de Google se puede utilizar para la sátira y las críticas políticas, un Domain Name que transporta un significado se puede volver a dirigir a cualquier otro Web page, a veces con intento malévolo.

[corrija] los visitantes de manipulación

El cambio de dirección del URL se utiliza a veces mientras que una parte de los ataques phishing que confunden a visitantes sobre qué Web site están visitando. Sin embargo, porque los hojeadores modernos demuestran siempre el URL verdadero en la barra de la dirección, se disminuye la amenaza. Sin embargo, vuelve a dirigir puede también llevarle a los sitios que intentarán de otra manera atacar de otras maneras. Por ejemplo, una reorientación pudo llevar a un usuario a un sitio que intentaría trampearlas en software e irónico la instalación del antivirus de la transferencia de un Trojan de una cierta clase en lugar de otro.

[corrija] las técnicas

Hay varias técnicas para ejecutar una reorientación. En muchos casos, restaure la etiqueta de la meta es la más simple. Sin embargo, existen varias opiniones fuertes que desalientan este método. [citación necesaria]

[corrija] el manual vuelve a dirigir

La técnica más simple es pedir que el visitante siga un acoplamiento a la nueva página, generalmente usando un ancla del HTML como tal:

¡Siga por favor el href= " http://www.example.com/ " >link del !

Este método es de uso frecuente como retraso para los métodos automáticos - si el hojeador del visitante no apoya el automático vuelve a dirigir método, el visitante puede todavía alcanzar el documento de la blanco siguiendo el acoplamiento.

[corrija] los códigos de estado 3xx del HTTP

En el protocolo del HTTP usado por el World Wide Web, una reorientación es una respuesta con un principio del código de estado con 3 que induzca a un hojeador que vaya a otra localización.

El estándar del HTTP define varios códigos de estado para el cambio de dirección:

  • 300 opciones múltiples (e.g. diversas idiomas de la oferta)
  • 301 movidos permanentemente
  • 302 encontrados (originalmente temporal vuelva a dirigir, pero ahora de uso general para especificar el cambio de dirección por razón sin especificar)
  • 303 ven otro (e.g. para los resultados de cgi-escrituras)
  • 307 temporales vuelven a dirigir

Todos estos códigos de estado requieren que el URL de la blanco de la reorientación esté dado en la localización: jefe de la respuesta de HTTP. Las 300 opciones múltiples enumerarán todas las opciones en el cuerpo del mensaje y demostrarán generalmente la opción del defecto en la localización: jefe.

Dentro de la gama 3xx, hay también algunos códigos de estado que son absolutamente diferentes del antedicho vuelven a dirigir (no se discuten aquí con sus detalles):

  • 304 no modificados
  • poder de 305 usos

Esto es una muestra de una respuesta de HTTP que utilice los 301 “movidos permanentemente” vuelva a dirigir:

HTTP/1.1 301 movido permanentemente

Localización: http://www.example.org/
Contenido-Tipo: texto/HTML
Contenido-Longitud: 174



Moved


Moved


los

This

paginan se han movido al href= " http://www.example.org/ " del http://www.example.org/ .




[corrija] usando el servidor-lado scripting para el cambio de dirección

A menudo, los autores de tela no tienen suficientes permisos para producir estos códigos de estado: El jefe del HTTP es generado por el programa del web server y no leído en el archivo para ese URL. Incluso para las escrituras de cgi, el web server genera generalmente el código de estado automáticamente y permite que los jefes de encargo sean agregados por la escritura. Para producir códigos de estado del HTTP con las cgi-escrituras, una necesita permitir a no-analizar-jefes.

A veces, es suficiente imprimir la “localización: “URL”” línea del jefe de una escritura de cgi del normal. Muchos web server eligen uno de los códigos de estado 3xx para tales contestaciones.

Los armazones para la generación del contenido del servidor-lado requieren típicamente que los jefes del HTTP estén generados antes de datos de la respuesta. Consecuentemente, el programador de la tela que está utilizando una lengua tan scripting para volver a dirigir el hojeador del usuario a otra página debe asegurarse de que la reorientación sea la primera o solamente la parte de la respuesta. En la lengua scripting del ASP, esto puede también ser realizado usando los métodos response.buffer=true y response.redirect “http://www.example.com”. Usando el PHP, uno puede utilizar el jefe (“localización: http://www.example.com ");.

Según el protocolo del HTTP, el jefe de la localización debe contener un URI absoluto [4]. Al volver a dirigir a partir de una página a otra dentro del mismo sitio, es un error común para utilizar un URI relativo. Consecuentemente la mayoría de los hojeadores toleran URIs relativo en el jefe de la localización, pero algunos hojeadores exhiben una advertencia al usuario final.

[corrija] usando .htaccess para el cambio de dirección

Al usar el Apache Web Server, los archivos directorio-específicos de .htaccess (así como los archivos de configuración principales de apache) pueden ser utilizados. Por ejemplo, volver a dirigir una sola página:

Vuelva a dirigir ^oldpage.html http://www.example.com/newpage.html [R=301, L]

Para cambiar los Domain Name usando example.com/.htaccess o dentro de una sección del en un config de Apache archivan:

RewriteEngine encendido


Del ^ de RewriteCond % {HTTP_HOST} ([^.:]+ \.)¿*oldwebsite \ .com \.? (: ¿[0-9] *)? $ [NC]
^ de RewriteRule (. *) $ http://www.preferredwebsite.net/$1 [R=301, L]

El uso de .htaccess con este fin no requiere generalmente permisos administrativos. Sin embargo, .htaccess se puede inhabilitar por su anfitrión, y así que puede no trabajar (o continuar trabajando) si él lo hace tan.

Además, algunas configuraciones de servidor pueden requerir la adición de la línea:

Opciones +FollowSymLinks

delante del “RewriteEngine en” directorio, para permitir el módulo del mod_rewrite.

Cuando usted tiene acceso a los archivos principales de los config de apache (tales como httpd.conf), es el mejor evitar el uso de los archivos de .htaccess.

Si el código se pone en un archivo de los config de Apache y no dentro de cualquier envase del , después el patrón de RewriteRule se debe cambiar para incluir una raya vertical principal:

RewriteEngine encendido


Del ^ de RewriteCond % {HTTP_HOST} ([^.:]+ \.)¿*oldwebsite \ .com \.? (: ¿[0-9] *)? $ [NC]
RewriteRule ^/(. *) $ http://www.preferredwebsite.net/$1 [R=301, L]

[corrija] restaure la etiqueta de la meta y el HTTP restaura el jefe

Netscape introdujo una característica para restaurar la página exhibida después de una cantidad determinada de tiempo. Este método a menudo se llama meta restaura. Es posible especificar el URL de la nueva página, así substituyendo una página después de una cierta hora por otra página:

Un descanso de los segundos 0 significa que un inmediato vuelve a dirigir. La meta restaura con un descanso de 0 que los segundos se aceptan como 301 la permanente vuelve a dirigir por Google, permitiendo transferir PageRank de archivos de HTML estáticos. [5]

Éste es un ejemplo de un documento simple del HTML que utilice esta técnica:



el http-equiv= del " restaura " el content= " 0; url= http://www.example.com/ " >

¡el

Please

sigue el href= " http://www.example.com/ " >link del !



  • Esta técnica es usable por todos los autores de tela porque la etiqueta de la meta se contiene dentro del documento sí mismo.
  • La etiqueta de la meta se debe colocar en la sección “principal” del archivo de HTML.
  • El número “0” en este ejemplo se puede substituir por otro número para alcanzar un retardo de eso muchos segundos.
  • Esto es una extensión propietaria al HTML introducido por Netscape pero apoyado por la mayoría de los hojeadores de la tela. El acoplamiento manual en la sección del “cuerpo” está para los usuarios cuyos hojeadores no apoyan esta característica.

Éste es un ejemplo de alcanzar del mismo efecto publicando un HTTP restaura el jefe:

Autorización HTTP/1.1 200

Restaure: 0; url= http://www.example.com/
Contenido-tipo: texto/HTML
Contenido-longitud: 78

¡Siga por favor el href= " http://www.example.com/ " >link del !

Esta respuesta es más fácil de generar por programas de cgi porque uno no necesita cambiar el código de estado del defecto. Aquí está un programa de cgi simple que efectúa esto vuelve a dirigir:

Nota: Generalmente, el servidor de HTTP agrega la línea de estado y el jefe de la Contenido-longitud automáticamente.

Este método es considerado por el W3C ser un método pobre de cambio de dirección, puesto que no comunica ninguna información sobre el recurso original o nuevo, al hojeador (o Search Engine). Las pautas de la accesibilidad del contenido de Web de W3C (7.4) desalientan la creación de páginas de auto-restauración, puesto que la mayoría de los hojeadores de la tela no permiten que el usuario inhabilite o controle la tarifa de restauración. Algunos artículos que han escrito en la edición incluyen las pautas de la accesibilidad del contenido de Web de W3C (1.0): Asegúrese que control del usuario de cambios y del estándar contentos sensibles al tiempo del uso vuelva a dirigir: ¡no rompa el botón trasero!

[corrija] el Javascript vuelve a dirigir

El Javascript ofrece varias maneras de exhibir una diversa página en la ventana de hojeador actual. Absolutamente con frecuencia, se utilizan para una reorientación. Sin embargo, hay varias razones para preferir el jefe del HTTP o la etiqueta de la meta de la restauración (siempre que es posible) sobre Javascript vuelve a dirigir:

[corrija] el capítulo vuelve a dirigir

Un efecto levemente diverso puede ser alcanzado creando un solo marco del HTML que contenga la página de la blanco:

rows= " 100% " del 

src= " http://www.example.com/ " del

</span><br /> &#161;<span class="sc2">el <body>Please</span> sigue el <span class="sc2"><span class="kw3">href=</span> <span class="st0">" http://www.example.com/ "</span> >link</a> del <a</span>! <span class="sc2"></body></span><br /><span class="sc2">

Una diferencia principal al antedicho vuelve a dirigir métodos es ésa para un marco vuelve a dirigir, las exhibiciones del hojeador el URL del documento del marco y no el URL de la página de la blanco en la barra del URL.

Esta técnica se llama comúnmente el disimular. Esto se puede utilizar de modo que el lector vea un URL más memorable o, con intenciones fraudulentas, de encubrir un sitio phishing como parte de spoofing del Web site. [6]

[corrija] vuelva a dirigir los lazos

Es absolutamente posible que uno vuelve a dirigir lleva a otro vuelve a dirigir. Por ejemplo, el URL http://www.wikipedia.com/wiki/URL_redirection (observe las diferencias en el Domain Name) primero se vuelve a dirigir a http://www.wikipedia.org/wiki/URL_redirection y se vuelve a dirigir otra vez al URL correcto: http://en.wikipedia.org/wiki/URL_redirection. Esto es apropiado: el primer cambio de dirección corrige el Domain Name incorrecto, el segundo cambio de dirección selecciona la sección correcta de la lengua, y finalmente, las exhibiciones del hojeador la página correcta.

A veces, sin embargo, un error puede hacer el cambio de dirección señalar de nuevo a la primera página, llevando a un bucle infinito de vuelve a dirigir. Los hojeadores se rompen que lazo después de algunos pasos y exhiben generalmente un mensaje de error en lugar de otro.

Los estados estándar del HTTP:

Un cliente DEBE detectar lazos infinitos del cambio de dirección, puesto que tales lazos generan el tráfico de red para cada cambio de dirección.

Las versiones previas de esta especificación recomendaron un máximo de cinco cambios de dirección; algunos clientes pueden existir ese instrumento una limitación tan fija.

[corrija] los servicios

Existen los servicios que pueden realizar el cambio de dirección del URL a pedido, sin la necesidad del trabajo técnico o el acceso al web server su sitio se recibe encendido.

[corrija] los servicios del cambio de dirección del URL

Un servicio de la reorientación es un sistema de la gestión de la información, que proporciona un acoplamiento de Internet que vuelva a dirigir a usuarios al contenido deseado. La ventaja típica al usuario es el uso de un Domain Name memorable, y una reducción en la longitud de la dirección del URL o de la tela. Un acoplamiento de reorientación se puede también utilizar como dirección permanente para el contenido que cambia con frecuencia los anfitriones, semejantemente al Domain Name System.

Los enlaces hipertexto que implican servicios del cambio de dirección del URL se utilizan con frecuencia en los mensajes del Spam dirigidos en los blogs y los wikis. Así, unidireccional reducir Spam es rechazar toda corrige y comenta conteniendo servicios sabidos del cambio de dirección del URL de los enlaces hipertexto; sin embargo, esto también quitará legítimo corrige y los comentarios y puede no ser un método eficaz para reducir Spam.

Recientemente, los servicios del cambio de dirección del URL han llevado usar AJAX como método eficiente, de uso fácil para crear URL acortados.

Una desventaja importante de algunos servicios del cambio de dirección del URL es el uso de las páginas del retardo, o publicidad basada marco, para generar el rédito.

[corrija] historia

El primeros vuelven a dirigir servicios se aprovecharon de los dominios a nivel superior (TLD) por ejemplo “.to” (Tonga),” .at " (Austria) y “.is” (Islandia). Su meta era hacer URL memorables. La primera corriente principal vuelve a dirigir servicio era V3.com que se jactó a 4 millones de usuarios en su pico en 2000. el éxito de V3.com fue atribuido a tener una gran variedad de dominios memorables cortos incluyendo “r.im”, “go.to”, “i.am”, “come.to” y “start.at”. V3.com fue adquirido por FortuneCity.com, compañía libre grande del recibimiento de tela, a principios de 1999. En 2001 emergió .tk (Tokelau) como TLD usado para los nombres memorables. [7] Mientras que el precio de venta de los dominios del nivel superior comenzó a bajar a partir del $70.00 por año a menos de $10.00, la demanda para los servicios memorables del cambio de dirección erosionó. [citación necesaria]

Con el lanzamiento de TinyURL en la nueva clase 2002 de volver a dirigir servicios nació, a saber el acortamiento del URL. Su meta era hacer URL largos cortos, para poder fijarlos en foros del Internet. Desde 2006, con el límite de 140 caracteres en el servicio extremadamente popular del gorjeo, estos servicios cortos del URL han considerado un resurgimiento.

[corrija] los servicios de la ofuscación del URL

Existen los servicios del cambio de dirección para ocultar el referrer usando META restaura, por ejemplo Anonymity.com y Anonym.to.

Esto es muy fácil de hacer con el PHP, por ejemplo en este ejemplo.

¿

/* este código se coloca en el public domain *
/* volverá a dirigir un URL *

$url = htmlspecialchars ($_GET [“URL”]);
¿? >

Redirect
el http-equiv= del ¿
URL=<? eco $url del PHP; ¿? > " >

¿el You debe poder ser vuelto a dirigir al href= del eco $url del PHP; ¿? ¿> " ><? eco $url del PHP; ¿? >.

Este código se puede entonces alcanzar por ejemplo,

http://example.org/redirect.php?url=http://www.google.com

El código antedicho del ejemplo puede no trabajar correctamente con los URL que contienen variables, a menos que la entrada primero se codifique, o se agrega el código que coloca a través del $_GETs y ensambla el URL final.

[corrija] vea también

[corrija] las referencias

  1. el ^ Google restablece vuelve a dirigir snoopery”. blog.anta.net. 2009-01-29. ISSN 1797-1993. http://blog.anta.net/2009/01/29/509/. 2009-01-30 recuperado.
  2. Problema serio del secuestro de Google del ^
  3. La parada 302 del ^ vuelve a dirigir y los raspadores de la banda del Web page del Hijacking - fila de la página
  4. ^ R. que coloca, y otros, petición de comentario: 2616, protocolo de transferencia de hipertexto - HTTP/1.1, publicó 1999-07, §14.30 “localización”, trajo 2008-10-07
  5. El ^ Google y Yahoo acepta los refreshs undelayed como 301 vuelve a dirigir, el 3 de septiembre de 2007, http://sebastians-pamphlets.com/google-and-yahoo-treat-undelayed-meta-refresh-as-301-redirect/ de la meta
  6. Tecnología Anti-Phishing del ^ ", Aaron Emigh, laboratorios de la raíz, 19 de enero de 2005
  7. ^ http://news.bbc.co.uk/2/hi/technology/6991719.stm

[corrija] los acoplamientos externos



No hay comentarios:

Publicar un comentario

Correo Vaishnava