Genera código de redirección 301 para archivos .htaccess. Redirige desde www a no-www o de no-www a www de tu dominio al instante.
Crea código de redirección 301 de www a no-www o no-www a www para Htaccess con Indexpro. Sigue los 3 pasos y haz clic en el botón "Obtener Código .htaccess".
No incluyas www. Solo el nombre de dominio - ej. tudominio.com
Una redirección .htaccess es una directiva de configuración del servidor que envía automáticamente a los visitantes de una URL a otra. El archivo .htaccess es un poderoso archivo de configuración usado en servidores web Apache.
Una redirección 301 es una redirección permanente que indica a los motores de búsqueda que la página se ha movido permanentemente a una nueva ubicación. Es el tipo de redirección más amigable para SEO porque pasa aproximadamente el 90-99% de la equidad de enlaces.
La redirección de www a no-www (o viceversa) es especialmente importante para el SEO porque los motores de búsqueda tratan www.example.com y example.com como dos sitios web diferentes.
Implementar redirecciones .htaccess adecuadas ofrece numerosos beneficios:
Four rules cover the great majority of real redirect work. Each goes in the .htaccess file at your document root, inside an IfModule mod_rewrite.c block with RewriteEngine On above it.
Sends every http request to the https version of the same URL, preserving the path.
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]Picks one canonical host so the same page is not reachable at two addresses.
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]For a page that moved. Point it at the closest equivalent, not the homepage.
Redirect 301 /old-page https://www.example.com/new-pageMoves a folder and everything under it, keeping the rest of the path intact.
RewriteRule ^old-folder/(.*)$ /new-folder/$1 [L,R=301]A 301 is permanent and tells Google to move the ranking signals to the new URL. A 302 is temporary and tells Google to keep the old one. Use 301 for anything that has genuinely moved. Using 302 by mistake is one of the most common ways sites lose rankings during a migration.
A 301 passes the great majority of it. What costs you is chaining: every extra hop adds latency and risk, and long chains can be abandoned by crawlers. Point the old URL at the final destination directly.
In the document root of your site, usually alongside the homepage file. Rules in a subdirectory's .htaccess apply only to that directory and below.
No. It is an Apache feature. Nginx uses its own configuration syntax and ignores .htaccess entirely, so rules pasted there will silently do nothing.
Almost always a rule that matches its own destination, so the redirect fires again on arrival. Adding a condition that excludes the target URL, such as a RewriteCond checking the host or path, breaks the cycle.
Only if there is genuinely no closer match. Google treats mass redirects to the homepage as soft 404s, which means the old URL gets dropped anyway. A relevant page or a clean 410 is usually better.