{"id":37785,"date":"2022-10-28T07:00:45","date_gmt":"2022-10-28T14:00:45","guid":{"rendered":"https:\/\/dhblog.dream.press\/blog\/?p=37785"},"modified":"2025-01-16T13:04:25","modified_gmt":"2025-01-16T21:04:25","slug":"guia-archivo-htaccess-wordpress","status":"publish","type":"post","link":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/","title":{"rendered":"Gu\u00eda Para Principiantes: Todo Lo Que Debes Saber Sobre el Archivo .htaccess De WordPress"},"content":{"rendered":"\n<p><span style=\"font-weight: 400;\">La gran prioridad (o una de las principales) para cada administrador de sitio web, deber\u00eda ser que su sitio sea seguro. WordPress es <\/span><a href=\"https:\/\/es.wordpress.org\/about\/security\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">una plataforma segura<\/span><\/a><span style=\"font-weight: 400;\"> fuera de lo com\u00fan, pero eso no significa que sea invulnerable ante ataques. Afortunadamente, puedes usar un archivo llamado <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> para fortalecer las pol\u00edticas de seguridad de tu sitio, as\u00ed no seas un experto en seguridad.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">El <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/216456227\" target=\"_blank\" rel=\"noopener\"><i><span style=\"font-weight: 400;\">.htaccess <\/span><\/i><span style=\"font-weight: 400;\">es un archivo de configuraci\u00f3n<\/span><\/a><span style=\"font-weight: 400;\"> para los servidores web de Apache, hogar de muchos sitios de WordPress. Es una herramienta poderosa que te permitir\u00e1 proteger tu sitio y potenciar su desarrollo, haciendo peque\u00f1os ajustes en su c\u00f3digo. Al editar este archivo, podr\u00e1s suspender seguidores, crear redirecciones, prevenir ataques y hasta evitar el acceso a \u00e1reas espec\u00edficas de tu sitio.<\/span><\/p>\n\n\n\n<h2 id=\"h-una-introduccion-al-archivo-htaccess\" class=\"wp-block-heading\"><b>Una Introducci\u00f3n al Archivo .htaccess<\/b><\/h2>\n\n\n\n<p><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> es una abreviatura para \u201c<\/span><i><span style=\"font-weight: 400;\">HyperText Access<\/span><\/i><span style=\"font-weight: 400;\">\u201d, o \u201cAcceso con Hipertexto\u201d. Es un archivo de configuraci\u00f3n que determina c\u00f3mo interact\u00faan tu sitio y los <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/217214317\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">servidores basados en Apache<\/span><\/a><span style=\"font-weight: 400;\">. En t\u00e9rminos m\u00e1s simples, el .<\/span><i><span style=\"font-weight: 400;\">htaccess<\/span><\/i><span style=\"font-weight: 400;\"> controla c\u00f3mo se accede a archivos en un directorio. Ampliando la descripci\u00f3n, es un seguro para tu sitio, porque con esto t\u00fa decides a qui\u00e9n dejas entrar a tu sitio y qu\u00e9 pueden hacer en \u00e9l.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Por defecto, un archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> estar\u00e1 normalmente <\/span><a href=\"https:\/\/wordpress.org\/support\/article\/htaccess\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">incluido en tu instalaci\u00f3n de WordPress<\/span><\/a><span style=\"font-weight: 400;\">. El prop\u00f3sito principal de este archivo es mejorar la seguridad y el rendimiento de tu sitio. Adem\u00e1s, te permitir\u00e1 anular configuraciones de tu servidor web.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Lo m\u00e1s probable es que puedas encontrar tu archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> en el directorio ra\u00edz de tu sitio. Dado que el <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> aplica tanto para su propio directorio como a cualquier subdirectorio dentro de la carpeta principal, por defecto, impactar\u00e1 todo tu sitio de WordPress.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Tambi\u00e9n vale la pena destacar que el archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> no tiene una extensi\u00f3n de archivo. El punto al comienzo existe simplemente para asegurarse de que este archivo se mantendr\u00e1 escondido.<\/span><\/p>\n\n\n\n<h2 id=\"h-como-editar-tu-archivo-htaccess-de-wordpress\" class=\"wp-block-heading\"><b>C\u00f3mo Editar Tu Archivo .htaccess de WordPress<\/b><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Editar el archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> es, en la pr\u00e1ctica, tan simple como editar cualquier otro archivo de texto. Sin embargo, como es un archivo <\/span><i><span style=\"font-weight: 400;\">core<\/span><\/i><span style=\"font-weight: 400;\">, o principal, puede llevarte a consecuencias inesperadas si le haces cambios.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Por esto, es realmente importante que hagas un <\/span><a href=\"https:\/\/www.dreamhost.com\/blog\/es\/tutorial-como-crear-copia-seguridad-wordpress\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">backup a tu sitio<\/span><\/a><span style=\"font-weight: 400;\"> antes de comenzar, sin importar si eres un principiante en el tema o un desarrollador experimentado.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Cuando est\u00e9s listo para editar tu archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\">, puedes ingresar a \u00e9l mediante el uso de un <\/span><a href=\"https:\/\/www.dreamhost.com\/blog\/ftp-sftp-guide-for-wordpress-users\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Secure File Transfer Protocol (SFTP)<\/span><\/a><span style=\"font-weight: 400;\"> o Secure Shell (<\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/115006413028-Crear-y-editar-un-archivo-v%C3%ADa-SSH\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">SSH<\/span><\/a><span style=\"font-weight: 400;\">). Encontrar\u00e1s el <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> en el directorio ra\u00edz de tu sitio:<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"861\" height=\"588\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/Archivo-htaccess-SFTP.jpg\" alt=\"Archivo .htaccess de un sitio WordPress a trav\u00e9s de SFTP\" class=\"wp-image-37790 lazyload\" data-srcset=\"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/10\/Archivo-htaccess-SFTP.jpg.webp 861w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/Archivo-htaccess-SFTP-300x205.jpg 300w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/Archivo-htaccess-SFTP-768x524.jpg 768w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/10\/Archivo-htaccess-SFTP-600x410.jpg.webp 600w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/10\/Archivo-htaccess-SFTP-750x512.jpg.webp 750w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/Archivo-htaccess-SFTP-100x68.jpg 100w\" data-sizes=\"(max-width: 861px) 100vw, 861px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 861px; --smush-placeholder-aspect-ratio: 861\/588;\" \/><\/figure><\/div>\n\n\n<p><span style=\"font-weight: 400;\">Abre el archivo utilizando tu editor de texto preferido, como TextEdit o Notepad. Si el archivo nunca antes ha sido editado, ver\u00e1s la siguiente informaci\u00f3n predeterminada:<\/span><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"900\" height=\"363\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/codigo-archivo-htaccess.jpg\" alt=\"Ejemplo de c\u00f3digo en un archivo .htacccess de WordPress\" class=\"wp-image-37791 lazyload\" data-srcset=\"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/10\/codigo-archivo-htaccess.jpg.webp 900w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/codigo-archivo-htaccess-300x121.jpg 300w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/codigo-archivo-htaccess-768x310.jpg 768w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/10\/codigo-archivo-htaccess-600x242.jpg.webp 600w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/10\/codigo-archivo-htaccess-750x303.jpg.webp 750w, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/codigo-archivo-htaccess-100x40.jpg 100w\" data-sizes=\"(max-width: 900px) 100vw, 900px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/363;\" \/><\/figure><\/div>\n\n\n<p><span style=\"font-weight: 400;\">Es importante no a\u00f1adir o cambiar nada antes de las etiquetas <\/span><span style=\"font-weight: 400;\"># BEGIN<\/span><span style=\"font-weight: 400;\"> y <\/span><span style=\"font-weight: 400;\"># END<\/span><span style=\"font-weight: 400;\">. En cambio, todo el c\u00f3digo nuevo debe ser a\u00f1adido despu\u00e9s de ese bloque de texto.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">A estas alturas, solo te faltar\u00e1 escribir tu c\u00f3digo y guardar el archivo. Cuando est\u00e1s a\u00f1adiendo varias funciones nuevas, lo mejor es guardar y probar cada una por separado. De este modo, si hay alg\u00fan error, ser\u00e1 mucho m\u00e1s f\u00e1cil entender cu\u00e1l cambio lo caus\u00f3 para entonces solucionarlo.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Aunque casi todas las instalaciones en WordPress ya tendr\u00e1n incluido un archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\">, habr\u00e1 algunos casos en que tendr\u00e1s que crearlo. Puedes hacerlo usando el editor de texto de tu preferencia, mientras lo guardes con el nombre de archivo correcto: <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> sin extensi\u00f3n.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Tambi\u00e9n es muy importante hacer <\/span><a href=\"https:\/\/wordpress.org\/support\/article\/changing-file-permissions\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">las configuraciones de permisos de archivo<\/span><\/a><span style=\"font-weight: 400;\"> correctamente. Luego podr\u00e1s subir el archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> al directorio ra\u00edz de tu sitio.<\/span><\/p>\n\n\n\n<h2 id=\"h-9-cosas-que-puedes-hacer-con-tu-archivo-htaccess-de-wordpress\" class=\"wp-block-heading\"><b>9 Cosas Que Puedes Hacer Con Tu Archivo .htaccess de WordPress<\/b><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">Ahora que te has familiarizado m\u00e1s con el archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\">, es hora de profundizar un poco. Vamos a presentarte algunas maneras f\u00e1ciles de editarlo, para que logres potenciar la seguridad y el desempe\u00f1o de tu sitio.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Solo utiliza los fragmentos de c\u00f3digo que te proporcionaremos m\u00e1s adelante. \u00a1Y recuerda crear una copia de seguridad antes de comenzar!<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-niega-el-acceso-a-partes-de-tu-sitio\"><b>1. Niega El Acceso A Partes De Tu Sitio<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Una de las cosas m\u00e1s \u00fatiles que puedes hacer con un <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> es <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/216363167-Negar-el-acceso-a-un-sitio-web-con-un-archivo-htaccess\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">negar el acceso<\/span><\/a><span style=\"font-weight: 400;\"> a ciertas p\u00e1ginas y archivos. Hay algunos archivos que deber\u00edas considerar esconder por razones de seguridad, como tu archivo de <\/span><a href=\"https:\/\/wordpress.org\/support\/article\/editing-wp-config-php\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">wp-config.php<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Puedes hacer esto a\u00f1adiendo el siguiente c\u00f3digo, el cual causar\u00e1 un <\/span><a href=\"https:\/\/www.dreamhost.com\/blog\/es\/como-arreglar-404-wordpress\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">error 404<\/span><\/a><span style=\"font-weight: 400;\"> si alguien intenta ver el archivo:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">&lt;Files ~ \"\/wp-config.php\"&gt;<\/span>\n<span style=\"font-weight: 400;\">Order Allow,Deny<\/span>\n<span style=\"font-weight: 400;\">Deny from All<\/span>\n<span style=\"font-weight: 400;\">&lt;\/Files&gt;<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Cuando los datos sensibles deben esconderse, tambi\u00e9n puede ser \u00fatil restringir el acceso al directorio correspondiente. Ya que muchos sitios de WordPress usan la misma estructura de carpetas, esta configuraci\u00f3n puede dejar vulnerable a tu sitio. Pero si a\u00f1ades la siguiente l\u00ednea, desactivar\u00e1s la funci\u00f3n de listado de directorios por defecto:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">Options -Indexes<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Esto detendr\u00e1 a los robots y usuarios para que no puedan ver tu estructura de carpetas. Entonces, si alguien trata de acceder, le saldr\u00e1, en cambio, una p\u00e1gina de <\/span><a href=\"https:\/\/www.dreamhost.com\/blog\/es\/como-solucionar-el-error-403-forbidden-en-wordpress\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">error 403<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-redirigir-y-reescribir-urls\"><b>2. Redirigir y Reescribir URLs<\/b><\/h3>\n\n\n\n<p><a href=\"https:\/\/www.dreamhost.com\/blog\/es\/guia-sobre-redireccones-web\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Crear redirecciones<\/span><\/a><span style=\"font-weight: 400;\"> te permitir\u00e1 enviar usuarios autom\u00e1ticamente a una p\u00e1gina espec\u00edfica. Las redirecciones pueden ser particularmente \u00fatiles si una p\u00e1gina ha sido movida o borrada, y quieres que los usuarios que intentaron acceder sean llevados a otro lado.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Puedes lograr esto con un plugin como <\/span><a href=\"https:\/\/wordpress.org\/plugins\/redirection\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Redirection<\/span><\/a><span style=\"font-weight: 400;\">, pero tambi\u00e9n es posible hacerlo si editas el archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\">. Entonces, para crear una redirecci\u00f3n, usa este c\u00f3digo:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">Redirect \/oldfile.html http:\/\/www.example.com\/newfile.html<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Probablemente, puedes ver lo que est\u00e1 pasando aqu\u00ed. La primera parte es la ruta al archivo antiguo, ese que quieres esconder, mientras que la segunda es la URL a donde quieres que tus visitantes sean redirigidos.<\/span><\/p>\n\n\n\n<div class=\"article-newsletter article-newsletter--gradient\">\n\n\n<h2>Get Content Delivered Straight to Your Inbox<\/h2><p>Subscribe now to receive all the latest updates, delivered directly to your inbox.<\/p><form class=\"nwsl-form\" id=\"newsletter_block_\" novalidate><div class=\"messages\"><\/div><div class=\"form-group\"><label for=\"input_newsletter_block_\"><input type=\"email\"name=\"email\"id=\"input_newsletter_block_\"placeholder=\"Enter your email address\"novalidatedisabled=\"disabled\"\/><\/label><button type=\"submit\"class=\"btn btn--brand\"disabled=\"disabled\"><span>Sign Me Up!<\/span><svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M13.8523 0.42524L12.9323 1.34521C12.7095 1.56801 12.7132 1.9304 12.9404 2.14865L16.7241 5.7823H0.5625C0.251859 5.7823 0 6.03416 0 6.3448V7.6573C0 7.96794 0.251859 8.2198 0.5625 8.2198H16.7241L12.9405 11.8535C12.7132 12.0717 12.7095 12.4341 12.9323 12.6569L13.8523 13.5769C14.072 13.7965 14.4281 13.7965 14.6478 13.5769L20.8259 7.39879C21.0456 7.17913 21.0456 6.82298 20.8259 6.60327L14.6477 0.42524C14.4281 0.205584 14.0719 0.205584 13.8523 0.42524Z\" fill=\"white\"\/>\n<\/svg>\n<\/button><\/div><\/form><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-fuerza-tu-sitio-a-cargar-de-modo-seguro-con-https\"><b>3. Fuerza Tu Sitio a Cargar De Modo Seguro Con HTTPS<\/b><\/h3>\n\n\n\n<p><style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }<\/style><\/p>\n\n\n\n<div class=\"embed-container\"><iframe data-src=\"https:\/\/www.youtube.com\/embed\/gNDtTMeS-z4\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe><\/div>\n\n\n\n<p><span style=\"font-weight: 400;\">Si has <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/215089118-Generalidades-sobre-proceso-de-agregar-un-certificado-SSL\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">a\u00f1adido un certificado SSL<\/span><\/a><span style=\"font-weight: 400;\"> a tu dominio, como <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/216539548-Agregar-un-certificado-gratuito-de-Let-s-Encrypt\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">el certificado gratuito Let\u2019s Encrypt<\/span><\/a><span style=\"font-weight: 400;\"> de DreamHost, es buena idea forzar a que tu sitio <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/215747758-Forzar-tu-sitio-a-cargar-de-forma-segura-con-un-archivo-htaccess\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">cargue usando HTTPS<\/span><\/a><span style=\"font-weight: 400;\">. Esto asegurar\u00e1 que sea seguro tanto para ti, como para tus visitantes.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Puedes hacer esto, a\u00f1adiendo el siguiente c\u00f3digo:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">RewriteEngine On<\/span>\n<span style=\"font-weight: 400;\">RewriteCond %{HTTPS} !=on<\/span>\n<span style=\"font-weight: 400;\">RewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">En este orden de ideas, tu sitio ahora redireccionar\u00e1 autom\u00e1ticamente cualquier solicitud HTTP y las redirigir\u00e1 a utilizar HTTPS. De modo m\u00e1s gr\u00e1fico, si un visitante trata de ingresar a <\/span><i><span style=\"font-weight: 400;\">http:\/\/www.ejemplo.com<\/span><\/i><span style=\"font-weight: 400;\">, ser\u00e1 redireccionado de inmediato a <\/span><i><span style=\"font-weight: 400;\">https:\/\/www.ejemplo.com<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-cambiar-configuraciones-de-cache\"><b>4. Cambiar Configuraciones de Cach\u00e9<\/b><\/h3>\n\n\n\n<p><a href=\"https:\/\/www.dreamhost.com\/blog\/es\/guia-almacenamiento-cache-web\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">El almacenamiento en cach\u00e9<\/span><\/a><span style=\"font-weight: 400;\"> es un proceso en el cual se guardan temporalmente algunos archivos en el dispositivo local de tus visitantes, para permitir que las p\u00e1ginas carguen m\u00e1s r\u00e1pido. Usando un <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\">, podr\u00e1s cambiar la cantidad de tiempo que duran tus archivos guardados en el cach\u00e9 del navegador hasta que sean actualizados con nuevas versiones.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Hay unas <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/216363157-Almacenar-el-cach%C3%A9-de-un-sitio-web-con-un-archivo-htaccess\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">pocas maneras<\/span><\/a><span style=\"font-weight: 400;\"> de hacer esto, pero, con fines ilustrativos, usaremos en este ejemplo una funci\u00f3n llamada <\/span><span style=\"font-weight: 400;\">mod_headers<\/span><span style=\"font-weight: 400;\">. El siguiente c\u00f3digo cambiar\u00e1 el tiempo m\u00e1ximo que el cach\u00e9 ser\u00e1 guardado para todos los archivos que lleven extensiones como <\/span><i><span style=\"font-weight: 400;\">jpg<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">jpeg<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">png<\/span><\/i><span style=\"font-weight: 400;\"> y <\/span><i><span style=\"font-weight: 400;\">gif<\/span><\/i><span style=\"font-weight: 400;\">:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">&lt;ifModule mod_headers.c&gt;<\/span>\n<span style=\"font-weight: 400;\">&lt;filesMatch \".(jpg|jpeg|png|gif)$\"&gt;<\/span>\n<span style=\"font-weight: 400;\">Header set Cache-Control \"max-age=2592000, public\"<\/span>\n<span style=\"font-weight: 400;\">&lt;\/filesMatch&gt;<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">En este ejemplo se configur\u00f3 el tiempo m\u00e1ximo a 2,592,000 segundos, lo que equivale a 30 d\u00edas. Podr\u00e1s cambiar esta cantidad si lo deseas, as\u00ed como las extensiones de archivo que ser\u00e1n afectadas. Si quieres a\u00f1adir diferentes configuraciones para diversas extensiones, es f\u00e1cil. Solo agrega m\u00e1s funciones de tipo <\/span><span style=\"font-weight: 400; font-family: 'courier new', courier, monospace;\">mod_header<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-5-prevenir-ciertos-ataques-de-script-injection\"><b>5. Prevenir Ciertos Ataques de Script Injection<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Los ataques de<\/span> <a href=\"https:\/\/es.wikipedia.org\/wiki\/Inyecci%C3%B3n_de_c%C3%B3digo\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Inyecci\u00f3n de Script<\/span><\/a><span style=\"font-weight: 400;\"> (o \u2018Inyecci\u00f3n de c\u00f3digo\u2019), intentan cambiar el funcionamiento de un sitio web o aplicaci\u00f3n, a\u00f1adiendo c\u00f3digo inv\u00e1lido. Por ejemplo, alguien puede a\u00f1adir un script a un campo de texto en tu sitio y luego a\u00f1adirlo a tu c\u00f3digo, lo que podr\u00eda ocasionar que tu sitio ejecute dicho script.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Puedes a\u00f1adir <\/span><a href=\"https:\/\/gist.github.com\/unix7\/1733822\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">este c\u00f3digo<\/span><\/a><span style=\"font-weight: 400;\"> para proteger tu sitio de varios tipos de Inyecci\u00f3n de Script:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">Options +FollowSymLinks<\/span>\n<span style=\"font-weight: 400;\">RewriteEngine On<\/span>\n<span style=\"font-weight: 400;\">RewriteCond %{QUERY_STRING} (&lt;|%3C).*script.*(&gt;|%3E) [NC,OR]<\/span>\n<span style=\"font-weight: 400;\">RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]<\/span>\n<span style=\"font-weight: 400;\">RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})<\/span>\n<span style=\"font-weight: 400;\">RewriteRule ^(.*)$ index.php [F,L]<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Tu sitio deber\u00eda ser ahora capaz de detectar y detener los intentos de inyecci\u00f3n de script y redireccionar al responsable a tu p\u00e1gina de <\/span><i><span style=\"font-weight: 400;\">index.php<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Sin embargo, es importante tener en cuenta que con este ejemplo no te proteger\u00e1s contra todas las clases de ataques de inyecci\u00f3n. Mientras este particular c\u00f3digo puede ser muy efectivo, no deber\u00edas usarlo como la <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/215947927-Habilitar-seguridad-web-adicional-para-un-sitio\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">\u00fanica protecci\u00f3n<\/span><\/a><span style=\"font-weight: 400;\"> contra este tipo de ataques.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-6-detener-ataques-username-enumeration\"><b>6. Detener Ataques \u2018Username Enumeration\u2019<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">El \u2018<\/span><i><span style=\"font-weight: 400;\">username enumeration<\/span><\/i><span style=\"font-weight: 400;\">\u2019, o enumeraci\u00f3n de nombres de usuario, es un proceso mediante el cual se recolectan justamente los nombres de usuario de tu sitio, revisando cada p\u00e1gina de autor de cada usuario. Esto puede ser muy problem\u00e1tico si alguien consigue encontrar tu nombre de administrador, lo que har\u00e1 mucho m\u00e1s f\u00e1cil para los bots el obtener acceso a tu sitio.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Puedes ayudar a prevenir el username enumeration a\u00f1adiendo <\/span><a href=\"https:\/\/www.kevinleary.net\/preventing-possible-attempt-enumerate-users-solved\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">este c\u00f3digo<\/span><\/a><span style=\"font-weight: 400;\">:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">RewriteCond %{REQUEST_URI} !^\/wp-admin [NC]<\/span>\n<span style=\"font-weight: 400;\">RewriteCond %{QUERY_STRING} author=d<\/span>\n<span style=\"font-weight: 400;\">RewriteRule .* - [R=403,L]<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Esto ayudar\u00e1 a detener ciertos intentos de enumeraci\u00f3n de usuarios y, en cambio, mostrar\u00e1 una p\u00e1gina de error 403. Ten presente que no siempre prevendr\u00e1 todo tipo de enumeraci\u00f3n, as\u00ed que deber\u00e1s probar tu seguridad m\u00e1s a fondo. Por eso, recomendamos fortalecer tu p\u00e1gina de inicio de sesi\u00f3n implementando <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/216013897-Generalidades-sobre-la-Autenticaci%C3%B3n-Multifactor\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">la Autenticaci\u00f3n Multifactor<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-7-previene-el-image-hotlinking-nbsp\"><b>7. Previene el Image Hotlinking&nbsp;<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">El <\/span><a href=\"https:\/\/themeisle.com\/blog\/prevent-image-hotlinking-in-wordpress\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Image hotlinking<\/span><\/a><span style=\"font-weight: 400;\">, o enlace directo de im\u00e1genes, es un problema com\u00fan que ocurre cuando las im\u00e1genes de tu servidor est\u00e1n siendo visualizadas en otro sitio web. Puedes detener esto a\u00f1adiendo <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/216363197-Prevenir-el-enlace-directo-de-im%C3%A1genes-hotlinking-\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">el siguiente c\u00f3digo<\/span><\/a><span style=\"font-weight: 400;\"> a tu archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\">:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">RewriteEngine On<\/span>\n<span style=\"font-weight: 400;\">RewriteCond %{HTTP_REFERER} !^$<\/span>\n<span style=\"font-weight: 400;\">RewriteCond %{HTTP_REFERER} !^https:\/\/(www.)?example.com\/.*$ [NC]<\/span>\n<span style=\"font-weight: 400;\">RewriteRule .(png|gif|jpg|jpeg)$ https:\/\/www.example.com\/wp-content\/uploads\/hotlink.gif [R,L]<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Reemplaza <\/span><i><span style=\"font-weight: 400;\">example.com<\/span><\/i><span style=\"font-weight: 400;\"> con tu propio dominio y este c\u00f3digo prevendr\u00e1 que las im\u00e1genes puedan cargar en otros sitios. En cambio, solo cargar\u00e1 la imagen que especifiques en la \u00faltima l\u00ednea de este c\u00f3digo. Puedes usar esto para enviar una imagen alternativa a los sitios que intenten visualizar im\u00e1genes o gr\u00e1ficos desde tu servidor.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Ten cuidado porque esto puede causar problemas cuando quieras que tus im\u00e1genes aparezcan nuevamente fuera de tu p\u00e1gina, por ejemplo, en motores de b\u00fasqueda. Te recomendamos, entonces, considerar enlazar a un script en lugar de a una imagen est\u00e1tica, luego responder con una imagen con marca de agua o una imagen que contenga un anuncio.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-8-controla-tus-extensiones-de-archivo\"><b>8. Controla Tus Extensiones de Archivo<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Usando <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\">, puedes controlar c\u00f3mo cargan en tu sitio archivos de diferentes extensiones. Hay mucho que puedes aprovechar de esta caracter\u00edstica, como <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/214200788-Forzar-a-otras-extensiones-de-archivo-a-cargar-como-PHP\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">ejecutar archivos como PHP<\/span><\/a><span style=\"font-weight: 400;\">, pero en esta ocasi\u00f3n te mostraremos un ejemplo m\u00e1s b\u00e1sico.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">El siguiente c\u00f3digo <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/215747728-Controlar-las-extensiones-de-archivos-con-un-archivo-htaccess\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">elimina la extensi\u00f3n de archivo de tus archivos PHP<\/span><\/a><span style=\"font-weight: 400;\">, una vez est\u00e1n cargados. Puedes usarlo con cualquier tipo de archivo, mientras reemplaces en todos los casos la etiqueta \u201cphp\u201d con la extensi\u00f3n que deseas o necesitas:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">RewriteEngine On<\/span>\n<span style=\"font-weight: 400;\">RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} \/.*index HTTP\/<\/span>\n<span style=\"font-weight: 400;\">RewriteRule ^(.*)index$ http:\/\/example.com\/$1 [L,R=301]<\/span>\n\n<span style=\"font-weight: 400;\">RewriteCond %{REQUEST_FILENAME} !-d<\/span>\n<span style=\"font-weight: 400;\">RewriteRule ^([^\/]+)\/$ http:\/\/example.com\/$1 [L,R=301]<\/span>\n\n<span style=\"font-weight: 400;\">RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} \/(.+).php HTTP\/<\/span>\n<span style=\"font-weight: 400;\">RewriteRule ^(.+).php$ http:\/\/example.com\/$1 [L,R=301]<\/span>\n<span style=\"font-weight: 400;\">RewriteRule ^([a-z]+)$ \/$1.php [L]<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">Esto causar\u00e1 que todos los archivos PHP carguen sin mostrar sus extensiones en la URL. Por ejemplo, el archivo <\/span><i><span style=\"font-weight: 400;\">index.php<\/span><\/i><span style=\"font-weight: 400;\"> aparecer\u00e1 solo como <\/span><i><span style=\"font-weight: 400;\">index<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-9-forzar-la-descarga-de-archivos\"><b>9. Forzar La Descarga de Archivos<\/b><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Finalmente, cuando un archivo es solicitado en tu sitio, el conducto regular del sistema es mostrarlo en el navegador. Por ejemplo, si est\u00e1s alojando un archivo de audio, este empezar\u00e1 a reproducirse en el navegador en lugar de guardarse en el computador de tus visitantes.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Puedes cambiar eso, <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/216363147-Forzar-un-archivo-a-que-se-descargue\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">forzando al sitio a que descargue los archivos<\/span><\/a><span style=\"font-weight: 400;\">, mediante este c\u00f3digo:<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400;\">AddType application\/octet-stream mp3<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400;\">En este ejemplo, hemos utilizado un archivo <\/span><i><span style=\"font-weight: 400;\">mp3<\/span><\/i><span style=\"font-weight: 400;\">, pero podr\u00e1s utilizar la misma funci\u00f3n para <\/span><i><span style=\"font-weight: 400;\">txt<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">mov<\/span><\/i><span style=\"font-weight: 400;\">, o cualquier otra extensi\u00f3n que consideres relevante.<\/span><\/p>\n\n\n\n<h2 id=\"h-mejora-la-seguridad-y-rendimiento-de-tu-sitio-web\" class=\"wp-block-heading\"><b>Mejora La Seguridad Y Rendimiento de Tu Sitio Web<\/b><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">El <\/span><a href=\"https:\/\/help.dreamhost.com\/hc\/es\/articles\/216456227-Generalidades-de-htaccess\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><\/a><span style=\"font-weight: 400;\"> ofrece flexibilidad para que puedas controlar el comportamiento de tu servidor. Tambi\u00e9n puedes usarlo para mejorar el desempe\u00f1o de tu sitio y adem\u00e1s, para tener un mayor control sobre qui\u00e9n puede (y qui\u00e9n no) acceder a tu informaci\u00f3n y datos sensibles.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Con un <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\">, puedes negar el acceso a partes espec\u00edficas de tu sitio web. Adicionalmente, te permite redireccionar URLs, forzar tu sitio a que cargue como HTTPS y prevenir ataques de inyecci\u00f3n de script.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Editar tu archivo <\/span><i><span style=\"font-weight: 400;\">.htaccess<\/span><\/i><span style=\"font-weight: 400;\"> es solo una manera de mejorar la seguridad de tu sitio. Pero elegir un <\/span><a href=\"https:\/\/www.dreamhost.com\/es\/wordpress\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">proveedor seguro de alojamiento de WordPress<\/span><\/a><span style=\"font-weight: 400;\"> es otra y muy \u00fatil. \u00c9chale un vistazo a nuestros planes de alojamiento administrado de DreamPress para conocer c\u00f3mo podemos impulsar el rendimiento y seguridad de tu sitio web.<\/span><span style=\"font-weight: 400;\"><\/span><\/p>\n\n\n\n\n<div\n\tclass=\"article-cta-shared article-cta-small\"\n>\n    <div class=\"tr-img-wrap-outer jsLoading\"><img decoding=\"async\" class=\"js-img-lazy \" src=\"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/lazy-loading-transparent.webp\" data-srcset=\"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder.webp 1x, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder-x2.webp 2x\"  alt=\"Ad background image\" \/><\/div>\n\n\n\n\n  <div class=\"content-btm\">\n    <h2\n      class=\"h2--md\"\n    >\n      Haz M\u00e1s Con DreamPress\n    <\/h2>\n    <p\n      class=\"p--md\"\n    >\n      \u00a1Los usuarios de DreamPress Plus y Pro obtienen acceso a Jetpack Professional (y m\u00e1s de 200 temas pr\u00e9mium) sin costo adicional!\n    <\/p>\n\n            <a\n            href=\"https:\/\/www.dreamhost.com\/es\/wordpress\/administrado\/\"\n                        class=\"btn btn--white-outline btn--sm btn--round\"\n                                    target=\"_blank\"\n            rel=\"noopener noreferrer\"\n            >\n                            Adquiere Tu Plan Hoy                    <\/a>\n\n  <\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>La gran prioridad (o una de las principales) para cada administrador de sitio web, deber\u00eda ser que su sitio sea seguro. WordPress es una plataforma segura fuera de lo com\u00fan, pero eso no significa que sea invulnerable ante ataques. Afortunadamente, puedes usar un archivo llamado .htaccess para fortalecer las pol\u00edticas de seguridad de tu sitio, [&hellip;]<\/p>\n","protected":false},"author":1062,"featured_media":37787,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_yoast_wpseo_metadesc":"En esta gu\u00eda te explicamos como funciona el archivo .htaccess de WordPress, como puedes editarlo y algo de c\u00f3digo clave. \u00a1Lee m\u00e1s aqu\u00ed!","toc_headlines":"[[\"h-una-introduccion-al-archivo-htaccess\",\"Una Introducci\u00f3n al Archivo .htaccess\"],[\"h-como-editar-tu-archivo-htaccess-de-wordpress\",\"C\u00f3mo Editar Tu Archivo .htaccess de WordPress\"],[\"h-9-cosas-que-puedes-hacer-con-tu-archivo-htaccess-de-wordpress\",\"9 Cosas Que Puedes Hacer Con Tu Archivo .htaccess de WordPress\"],[\"h-mejora-la-seguridad-y-rendimiento-de-tu-sitio-web\",\"Mejora La Seguridad Y Rendimiento de Tu Sitio Web\"]]","hide_toc":false,"footnotes":""},"categories":[11668,11683],"tags":[],"class_list":["post-37785","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutoriales","category-wordpress-es"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.3 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Gu\u00eda Para Principiantes: Archivo .htaccess De WordPress - DreamHost<\/title>\n<meta name=\"description\" content=\"En esta gu\u00eda te explicamos como funciona el archivo .htaccess de WordPress, como puedes editarlo y algo de c\u00f3digo clave. \u00a1Lee m\u00e1s aqu\u00ed!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gu\u00eda Para Principiantes: Todo Lo Que Debes Saber Sobre el Archivo .htaccess De WordPress\" \/>\n<meta property=\"og:description\" content=\"En esta gu\u00eda te explicamos como funciona el archivo .htaccess de WordPress, como puedes editarlo y algo de c\u00f3digo clave. \u00a1Lee m\u00e1s aqu\u00ed!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"DreamHost Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DreamHost\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-28T14:00:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-16T21:04:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/WordPress-.htaccess-File-ES.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jason Cosper\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:site\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jason Cosper\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Gu\u00eda Para Principiantes: Archivo .htaccess De WordPress - DreamHost","description":"En esta gu\u00eda te explicamos como funciona el archivo .htaccess de WordPress, como puedes editarlo y algo de c\u00f3digo clave. \u00a1Lee m\u00e1s aqu\u00ed!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"Gu\u00eda Para Principiantes: Todo Lo Que Debes Saber Sobre el Archivo .htaccess De WordPress","og_description":"En esta gu\u00eda te explicamos como funciona el archivo .htaccess de WordPress, como puedes editarlo y algo de c\u00f3digo clave. \u00a1Lee m\u00e1s aqu\u00ed!","og_url":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/","og_site_name":"DreamHost Blog","article_publisher":"https:\/\/www.facebook.com\/DreamHost\/","article_published_time":"2022-10-28T14:00:45+00:00","article_modified_time":"2025-01-16T21:04:25+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/WordPress-.htaccess-File-ES.jpg","type":"image\/jpeg"}],"author":"Jason Cosper","twitter_card":"summary_large_image","twitter_creator":"@dreamhost","twitter_site":"@dreamhost","twitter_misc":{"Written by":"Jason Cosper","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/#article","isPartOf":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/"},"author":{"name":"Jason Cosper","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#\/schema\/person\/2273b8bf7336df78f6d99a89c17253c4"},"headline":"Gu\u00eda Para Principiantes: Todo Lo Que Debes Saber Sobre el Archivo .htaccess De WordPress","datePublished":"2022-10-28T14:00:45+00:00","dateModified":"2025-01-16T21:04:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/"},"wordCount":2095,"publisher":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/WordPress-.htaccess-File-Feature-1.jpg","articleSection":["Tutoriales","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/","url":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/","name":"Gu\u00eda Para Principiantes: Archivo .htaccess De WordPress - DreamHost","isPartOf":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/WordPress-.htaccess-File-Feature-1.jpg","datePublished":"2022-10-28T14:00:45+00:00","dateModified":"2025-01-16T21:04:25+00:00","description":"En esta gu\u00eda te explicamos como funciona el archivo .htaccess de WordPress, como puedes editarlo y algo de c\u00f3digo clave. \u00a1Lee m\u00e1s aqu\u00ed!","breadcrumb":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/#primaryimage","url":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/WordPress-.htaccess-File-Feature-1.jpg","contentUrl":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/10\/WordPress-.htaccess-File-Feature-1.jpg","width":900,"height":598},{"@type":"BreadcrumbList","@id":"https:\/\/www-dev.dreamhost.com\/blog\/es\/guia-archivo-htaccess-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dhblog.dream.press\/blog\/"},{"@type":"ListItem","position":2,"name":"Gu\u00eda Para Principiantes: Todo Lo Que Debes Saber Sobre el Archivo .htaccess De WordPress"}]},{"@type":"WebSite","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#website","url":"https:\/\/www-dev.dreamhost.com\/blog\/","name":"DreamHost Blog","description":"","publisher":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www-dev.dreamhost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#organization","name":"DreamHost","url":"https:\/\/www-dev.dreamhost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","contentUrl":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","width":1200,"height":168,"caption":"DreamHost"},"image":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DreamHost\/","https:\/\/x.com\/dreamhost","https:\/\/www.instagram.com\/dreamhost\/","https:\/\/www.linkedin.com\/company\/dreamhost\/","https:\/\/www.youtube.com\/user\/dreamhostusa"]},{"@type":"Person","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#\/schema\/person\/2273b8bf7336df78f6d99a89c17253c4","name":"Jason Cosper","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","url":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","contentUrl":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","caption":"Jason Cosper"},"description":"Jason is DreamHost\u2019s WordPress Product Advocate, based out of Bakersfield, CA. He is currently working on making our DreamPress product even better. In his free time, he likes to curl up on the couch and watch scary movies with his wife Sarah and three very small dogs. Follow him on Twitter.","url":"https:\/\/www-dev.dreamhost.com\/blog\/author\/jasoncosper\/"}]}},"lang":"es","translations":{"es":37785,"en":37762,"pt":52508,"de":53999,"pl":54005,"uk":54037,"ru":54399,"it":68094,"fr":69779,"nl":69803},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/37785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/users\/1062"}],"replies":[{"embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/comments?post=37785"}],"version-history":[{"count":8,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/37785\/revisions"}],"predecessor-version":[{"id":63150,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/37785\/revisions\/63150"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/media\/37787"}],"wp:attachment":[{"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/media?parent=37785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/categories?post=37785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/tags?post=37785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}