Instalación de la no-WWW redireccionamiento 301 en un servidor Apache
1. Ensure that your hosting provider has the Apache Rewrite Module turned on; this is a definite requirement for this fix to work. Asegúrese de que su proveedor de alojamiento tiene el módulo de reescritura de Apache activado, y este es un requisito definido para esta revisión al trabajo. In most cases your hosting provider will not have a problem enabling the module if it isn't already enabled (it seems to be on in most circumstances).If you have access to the httpd.conf file on your server then you can actually enable the module yourself. En la mayoría de los casos, su proveedor de hosting no tiene un problema de habilitar el módulo si no está ya activado (que parece estar en la mayoría de los casos). Si usted tiene acceso al archivo httpd.conf de su servidor, entonces en realidad se puede permitir el mismo módulo. Open the httpd.conf file, back it up somewhere in case of error (you cannot be too safe) and then uncomment the following line: LoadModule rewrite_module modules/mod_rewrite.so Once the line is uncommented, save the file and restart the server then proceed with the following steps. Abra el archivo httpd.conf, una copia de seguridad en algún lugar en caso de error (no se puede ser demasiado fuerte) y luego descomentar la siguiente línea: LoadModule módulos rewrite_module / mod_rewrite.so Una vez que la línea está comentada, guarde el archivo y reiniciar el servidor, a continuación proceder con los pasos siguientes.
2. Download the .htaccess file from your website's root web folder to a folder on your machine where you can edit it. Descargue el archivo. Htaccess de la carpeta de su sitio web raíz de la web en una carpeta en el equipo donde se puede editar.
3. Make a copy of the .htaccess file and save it somewhere else for safe keeping in case you need to revert to the old version – do not edit this version. Haga una copia del archivo htaccess y guardarlo en otro lugar para su custodia en caso de que necesite volver a la versión anterior -. No editar esta versión.
4. Open the original .htaccess you downloaded in Notepad Abra el original. Htaccess que descargó en el Bloc de notas
5. Add the following code (in red) into the .htaccess file. Agregue el siguiente código (en rojo) en el archivo htaccess.. Be sure to substitute “ example.com ” with your own website information but touch nothing else. RewriteEngine On Asegúrese de sustituir "example.com" con la información de su propio sitio web, pero nada más tocar. RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com RewriteCond% {} ^ HTTP_HOST example.com
RewriteRule (.*)
http://www.example.com/$1 [R=301,L] RewriteRule (.*)
http://www.example.com/ $ 1 [R = 301, L]
6. Upload the file back to your website in the exact same place you downloaded it. Sube el archivo a su sitio web en el lugar exacto el mismo que lo descargado.
7. Once the upload is complete open a browser and try visiting the “non-www” version of your website address. Una vez que la carga está completa abrir un navegador y tratar de visitar la "no-www" versión de la dirección del sitio web. If the .htaccess is working as it should you will be redirected immediately to the proper “www” version of your website. Si el htaccess. Funciona como debe se le redirigirá inmediatamente a la correcta "www" la versión de su sitio web. This will be reflected in your browser's address bar. Esto se reflejará en la barra de direcciones de tu navegador.
8. To be 100% certain this has worked appropriately I suggest visiting this URL and typing in your “non-www” website address into the HTTP Server Header Checker . Para estar 100% seguro de esto ha funcionado adecuadamente sugiero visitar la siguiente dirección URL y escribiendo en su-www "dirección del sitio web no" en el servidor HTTP Header Checker . This tool will show you whether the 301 redirect is being provided by the server. Esta herramienta le mostrará si la redirección 301 está siendo proporcionada por el servidor. This is what a search engine will see when it visits the site. Esto es lo que un motor de búsqueda a ver cuando te visita el sitio. The result should look like the following areas in red: El resultado debe ser similar a las siguientes áreas en rojo:
#1 Server Response:
http://example.com # 1 Respuesta del servidor:
http://example.com
HTTP Status Code: HTTP/1.1 301 Moved Permanently Código de estado HTTP: HTTP/1.1 301 Movido permanentemente
Date: Wed, 14 Mar 2007 22:49:28 GMT Fecha: Wed, 14 Mar 2007 22:49:28 GMT
Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
Location:
http://www.example.com/ Ubicación:
http://www.example.com/
Connection: close Conexión: cerrar
Content-Type: text/html; charset=iso-8859-1 Content-Type: / texto html; charset = ISO-8859-1
Redirect Target:
http://www.example.com/ Redirigir Objetivo:
http://www.example.com/
#2 Server Response:
http://www.example.com/ # 2 Respuesta del servidor:
http://www.example.com/
HTTP Status Code: HTTP/1.1 200 OK Código de estado HTTP: HTTP/1.1 200 OK
Date: Wed, 14 Mar 2007 22:49:28 GMT Fecha: Wed, 14 Mar 2007 22:49:28 GMT
Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b Server: Apache/1.3.27 (Unix) PHP/4.4.1 FrontPage/5.0.2.2510 mod_ssl/2.8.14 OpenSSL/0.9.6b
Connection: close Conexión: cerrar
Content-Type: text/html Content-Type: text / html
9. If the redirect worked you are done! Si la redirección trabajado ya está! Congratulations.If this has not worked you need to restore the backup you made of the .htaccess file to your website. Congratulations.If esto no ha trabajado lo que necesita para restaurar la copia de seguridad que hizo del archivo. Htaccess a tu sitio web. After the backup is restored go back and review the revised .htaccess on your computer, compare the information to the instructions above and make sure there were no mistakes. Después de la copia de seguridad se restaura volver atrás y revisar la versión revisada. Htaccess en el equipo, comparar la información de las instrucciones de arriba y asegúrese de que no hubo errores. If no mistakes are found your server may require custom programming which is beyond the scope of this FAQ; please contact your hosting provider for more information. Si no hay errores se encuentran el servidor puede requerir programación personalizada que está más allá del alcance de este FAQ, por favor, contacte con su proveedor de alojamiento para más información.
Read more: Cómo redirección 301 no WWW a URLs WWW | StepForth Web Marketing Inc.
Under Creative Commons License: Attribution