Title: Redirección a https
Last modified: 19 de mayo de 2020

---

# Redirección a https

 *  Resuelto [Dram](https://es.wordpress.org/support/users/astromicologist/)
 * (@astromicologist)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/)
 * Hola,
 * desde hace poco he notado que solo me redirige a https el home, las demás paginas,
   protuctos y post de mi web son accesibles tanto con http como con https por algún
   motivo dejó de redireccionar el resto a excepción del home.
 * por seguridad me gustaría resolverlo.
 * ¿Alguna recomendación o ayuda porfavor?
 * Muchas gracias.
    Saludos
 * Este es el .htaccess tal y como está ahora mismo
 *     ```
       # BEGIN WpFastestCache
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteCond %{HTTPS} =on
       RewriteCond %{HTTP_HOST} ^www.dinosaurios.tienda
       # Start WPFC Exclude
       # End WPFC Exclude
       # Start_WPFC_Exclude_Admin_Cookie
       RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=mi-usuario :)
       # End_WPFC_Exclude_Admin_Cookie
       RewriteCond %{HTTP_HOST} ^www.dinosaurios.tienda
       RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|WP_FASTEST_CACHE_CSS_VALIDATOR|Twitterbot|LinkedInBot|WhatsApp|Mediatoolkitbot)
       RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot)
       RewriteCond %{REQUEST_METHOD} !POST
       RewriteCond %{REQUEST_URI} !(\/){2}$
       RewriteCond %{REQUEST_URI} \/$
       RewriteCond %{QUERY_STRING} !.+
       RewriteCond %{HTTP:Cookie} !wordpress_logged_in
       RewriteCond %{HTTP:Cookie} !comment_author_
       RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil
       RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
       RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
       RewriteCond /home/receoszm/dinosaurios.tienda/wp-content/cache/all/$1/index.html -f
       RewriteRule ^(.*) "/wp-content/cache/all/$1/index.html" [L]
       </IfModule>
       <FilesMatch "index\.(html|htm)$">
       AddDefaultCharset UTF-8
       <ifModule mod_headers.c>
       FileETag None
       Header unset ETag
       Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
       Header set Pragma "no-cache"
       Header set Expires "Mon, 29 Oct 1923 20:30:00 GMT"
       </ifModule>
       </FilesMatch>
       # END WpFastestCache
       # BEGIN GzipWpFastestCache
       <IfModule mod_deflate.c>
       AddType x-font/woff .woff
       AddType x-font/ttf .ttf
       AddOutputFilterByType DEFLATE image/svg+xml
       AddOutputFilterByType DEFLATE text/plain
       AddOutputFilterByType DEFLATE text/html
       AddOutputFilterByType DEFLATE text/xml
       AddOutputFilterByType DEFLATE text/css
       AddOutputFilterByType DEFLATE text/javascript
       AddOutputFilterByType DEFLATE application/xml
       AddOutputFilterByType DEFLATE application/xhtml+xml
       AddOutputFilterByType DEFLATE application/rss+xml
       AddOutputFilterByType DEFLATE application/javascript
       AddOutputFilterByType DEFLATE application/x-javascript
       AddOutputFilterByType DEFLATE application/x-font-ttf
       AddOutputFilterByType DEFLATE x-font/ttf
       AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
       AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot font/otf
       </IfModule>
       # END GzipWpFastestCache
       # BEGIN LBCWpFastestCache
       <FilesMatch "\.(webm|ogg|mp4|ico|pdf|flv|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|otf|ttf|svg|eot)(\.gz)?$">
       <IfModule mod_expires.c>
       AddType application/font-woff2 .woff2
       AddType application/x-font-opentype .otf
       ExpiresActive On
       ExpiresDefault A0
       ExpiresByType video/webm A10368000
       ExpiresByType video/ogg A10368000
       ExpiresByType video/mp4 A10368000
       ExpiresByType image/webp A10368000
       ExpiresByType image/gif A10368000
       ExpiresByType image/png A10368000
       ExpiresByType image/jpg A10368000
       ExpiresByType image/jpeg A10368000
       ExpiresByType image/ico A10368000
       ExpiresByType image/svg+xml A10368000
       ExpiresByType text/css A10368000
       ExpiresByType text/javascript A10368000
       ExpiresByType application/javascript A10368000
       ExpiresByType application/x-javascript A10368000
       ExpiresByType application/font-woff2 A10368000
       ExpiresByType application/x-font-opentype A10368000
       ExpiresByType application/x-font-truetype A10368000
       </IfModule>
       <IfModule mod_headers.c>
       Header set Expires "max-age=A10368000, public"
       Header unset ETag
       Header set Connection keep-alive
       FileETag None
       </IfModule>
       </FilesMatch>
       # END LBCWpFastestCache
   
       # BEGIN WordPress
       # Las directivas (líneas) entre <code>BEGIN WordPress</code> y <code>END WordPress</code> se generan dinámicamente
       # , y solo se deberían modificar mediante filtros de WordPress.
       # Cualquier cambio en las directivas que hay entre esos marcadores se sobreescribirán.
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       #BEGIN EVITAR HOTLINKING
       RewriteEngine On
       RewriteCond %{HTTP_REFERER} !^https://(.+\.)?dinosaurios\.tienda/.*$ [NC]
       RewriteCond %{HTTP_REFERER} !^$
       RewriteRule .*\.(jpe?g|gif|bmp|png)$ https://i.postimg.cc/qM5qYZ0F/404bicho.gif [L]
       #END EVITAR HOTLINKING
   
       #BEGIN Errores
       ErrorDocument 500 /500.shtml
       ErrorDocument 502 /502.shtml
       ErrorDocument 504 /504.shtml
       ErrorDocument 508 /508.shtml
       #END Errores
   
       php_value upload_max_filesize 64M
       php_value post_max_size 64M
       php_value max_execution_time 300
       php_value max_input_time 300
   
       #BEGIN PROTECCION
       # protege el archivo xmlrpc
       <Files xmlrpc.php>
       order allow,deny
       deny from all
       </Files>
   
       # protege el archivo wp-login
       <Files wp-login.php>
       order allow,deny
       deny from all
       </Files>
   
       # protege el archivo htaccess
       <files .htaccess>
       order allow,deny
       deny from all
       </files>
   
       <Files 403.shtml>
       order allow,deny
       allow from all
       </Files>
   
       # Evita busquedas de vulnerabilidades.
       RedirectMatch 403 \[
   
       #END PROTECCION
   
       #BEGIN SECURITY HEADERS
       # Añadir Security Header: X-XSS-Protection Missing
       <IfModule mod_headers.c>
         Header set X-XSS-Protection "1; mode=block"
       </IfModule>
   
       # Añadir Security Header: X-Content-Type-Options nosniff
       <IfModule mod_headers.c>
         Header set X-Content-Type-Options nosniff
       </IfModule>
       #END SECURITY HEADERS
   
       #BEGIN EXPIRE HEADERS
       ## Expire headers - EXPIRES CACHING ##
       <IfModule mod_expires.c>
         ExpiresActive on
   
       # Perhaps better to whitelist expires rules? Perhaps.
         ExpiresDefault                          "access plus 1 month"
   
       # Data
         ExpiresByType text/xml                  "access plus 0 seconds"
         ExpiresByType application/xml           "access plus 0 seconds"
         ExpiresByType application/json          "access plus 0 seconds"
   
       # Favicon (cannot be renamed)
         ExpiresByType image/x-icon              "access plus 1 week"
   
       # Media: images, video, audio
         ExpiresByType image/gif                 "access plus 1 year"
         ExpiresByType image/png                 "access plus 1 year"
         ExpiresByType image/jpeg                "access plus 1 year"
         ExpiresByType video/ogg                 "access plus 1 year"
         ExpiresByType audio/ogg                 "access plus 1 year"
         ExpiresByType video/mp4                 "access plus 1 year"
         ExpiresByType video/webm                "access plus 1 year"
   
       # Webfonts
         ExpiresByType application/x-font-ttf    "access plus 1 month"
         ExpiresByType font/opentype             "access plus 1 month"
         ExpiresByType application/x-font-woff   "access plus 1 month"
         ExpiresByType image/svg+xml             "access plus 1 month"
         ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
   
       # CSS and JavaScript
         ExpiresByType text/css                  "access plus 1 month"
         ExpiresByType text/javascript           "access plus 1 month"
         ExpiresByType application/javascript    "access plus 1 month"
   
       # Others
         ExpiresByType application/pdf "access plus 1 month"
         ExpiresByType application/x-shockwave-flash "access plus 1 month"
   
       </IfModule>
       #END EXPIRE HEADERS
   
       # BEGIN FRedirect_ErrorDocument
       # Las directivas (líneas) entre <code>BEGIN FRedirect_ErrorDocument</code> y <code>END FRedirect_ErrorDocument</code> se generan dinámicamente
       # , y solo se deberían modificar mediante filtros de WordPress.
       # Cualquier cambio en las directivas que hay entre esos marcadores se sobreescribirán.
       ErrorDocument 404 /index.php?error=404
       # END FRedirect_ErrorDocument
       ```
   
 * La página con la que necesito ayuda: _[[accede](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fes.wordpress.org%2Fsupport%2Ftopic%2Fredireccion-a-https%2F%3Foutput_format%3Dmd&locale=es_ES)
   para ver el enlace]_

Viendo 11 respuestas - de la 1 a la 11 (de un total de 11)

 *  Moderador [almendron](https://es.wordpress.org/support/users/almendron/)
 * (@almendron)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177226)
 * No veo en ese código nada para redireccionar a https y sin embargo, como tú mismo
   comentas, sí la hace para la página principal.
 * ¿Has instalado WordPress en una carpeta? ¿en qué lugar está el htaccess que muestras?¿
   en la raíz del sitio o en una carpeta?
 *  Iniciador del debate [Dram](https://es.wordpress.org/support/users/astromicologist/)
 * (@astromicologist)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177234)
 * Hola,
 * Esta instalado normal, el htaccess está en el root.
    He incluido el htaccess 
   en esta pregunta Porque WpFastestCache añade lo siguiente: (Pero Aunque restaure
   el htaccess y desinstale WpFastestCache sigue sucediendo lo mismo no creo que
   venga de ahí el problema) y es raro que suceda ya que La redirección 301 no es
   necesaria, porque WP incluye la suya por PHP.
 *     ```
       # BEGIN WpFastestCache
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteCond %{HTTPS} =on
       RewriteCond %{HTTP_HOST} ^www.dinosaurios.tienda
       ```
   
 *  Moderador [almendron](https://es.wordpress.org/support/users/almendron/)
 * (@almendron)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177237)
 * Efectivamente, debería hacerlo el WordPress pero no lo ejecuta si está en una
   carpeta.
    Entiendo que estás usando un subdominio: ¿a dónde apunta?
 *  Moderador [almendron](https://es.wordpress.org/support/users/almendron/)
 * (@almendron)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177238)
 * No he dicho nada. No sabía que .tienda era un dominio de primer nivel 🙂
 *  Iniciador del debate [Dram](https://es.wordpress.org/support/users/astromicologist/)
 * (@astromicologist)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177239)
 * Hola,
 * Es un dominio normal [https://www.dinosaurios.tienda/](https://www.dinosaurios.tienda/)
   lo tengo apuntado a las DNS de mi hosting.
 * Tengo un hosting con un dominio principal, y los demás son Addon Domain añadidos
   desde cPanel.
 * Acabo de borrar y reinstalar todos los certificados SLL «por si las moscas» pero
   sigue igual
 * Gracias.
 *  Moderador [almendron](https://es.wordpress.org/support/users/almendron/)
 * (@almendron)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177240)
 * Haz lo siguiente:
 * 1) Desactiva el WpFastestCache. Si hay una opción específica para que no te ponga
   ninguna redireccción, mucho mejor que desactivarlo del todo.
 * 2) Añade al principio del htacces lo siguiente:
 *     ```
       <IfModule mod_rewrite.c>
       RewriteCond %{HTTPS} !on
       RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]
       </IfModule>
       ```
   
 * Y luego añades:
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{HTTP_HOST} ^dinosaurios\.tienda$ [NC]
       RewriteRule ^(.*)$ https://www.dinosaurios.tienda//$1 [R=301,L]
       </IfModule>
       ```
   
 * El primer código es la redirección de «http» a «https».
    El segundo código para
   pasar de «sin www» a «www»
 *  Moderador [almendron](https://es.wordpress.org/support/users/almendron/)
 * (@almendron)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177241)
 * Corrijo el segundo código que sobra una `/`
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{HTTP_HOST} ^dinosaurios\.tienda$ [NC]
       RewriteRule ^(.*)$ https://www.dinosaurios.tienda/$1 [R=301,L]
       </IfModule>
       ```
   
 *  Iniciador del debate [Dram](https://es.wordpress.org/support/users/astromicologist/)
 * (@astromicologist)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177244)
 * Funciona!! Eureka!! Gracias!!
 * Primero He desactivado WpFastestCache y añadido los codigos como me decias, y
   funciona.
 * Después he activado otra vez WpFastestCache ya que lo necesito bastante (no trae
   opción de redirección, añade esa redirección por que quiere no me da opción, 
   y tambien añade automaticamente su código cuando lo activas al principio del 
   todo)
 * Y sigue funcionando, al final el htaccess ha quedado así.
 * # BEGIN WpFastestCache
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase/
   RewriteCond %{HTTPS} =on RewriteCond %{HTTP_HOST} ^www.dinosaurios.tienda # Start
   WPFC Exclude # End WPFC Exclude # Start_WPFC_Exclude_Admin_Cookie RewriteCond%{
   HTTP:Cookie} !wordpress_logged_in_[^\=]+\=mi-usuario # End_WPFC_Exclude_Admin_Cookie
   RewriteCond %{HTTP_HOST} ^www.dinosaurios.tienda RewriteCond %{HTTP_USER_AGENT}!(
   facebookexternalhit|WP_FASTEST_CACHE_CSS_VALIDATOR|Twitterbot|LinkedInBot|WhatsApp
   |Mediatoolkitbot) RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\
   siPhone\sMobile)?\s*Bot) RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{REQUEST_URI}!(\/){
   2}$ RewriteCond %{REQUEST_URI} \/$ RewriteCond %{QUERY_STRING} !.+ RewriteCond%{
   HTTP:Cookie} !wordpress_logged_in RewriteCond %{HTTP:Cookie} !comment_author_
   RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil RewriteCond %{HTTP:Profile}!
   ^[a-z0-9\»]+ [NC] RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.
   html -f [or] RewriteCond /home/usuario/dinosaurios.tienda/wp-content/cache/all/
   $1/index.html -f RewriteRule ^(.*) «/wp-content/cache/all/$1/index.html» [L] 
   </IfModule> <FilesMatch «index\.(html|htm)$»> AddDefaultCharset UTF-8 <ifModule
   mod_headers.c> FileETag None Header unset ETag Header set Cache-Control «max-
   age=0, no-cache, no-store, must-revalidate» Header set Pragma «no-cache» Header
   set Expires «Mon, 29 Oct 1923 20:30:00 GMT» </ifModule> </FilesMatch> # END WpFastestCache#
   BEGIN GzipWpFastestCache <IfModule mod_deflate.c> AddType x-font/woff .woff AddType
   x-font/ttf .ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType
   DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType
   DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType
   DEFLATE text/javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType
   DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml
   AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE
   application/x-javascript AddOutputFilterByType DEFLATE application/x-font-ttf
   AddOutputFilterByType DEFLATE x-font/ttf AddOutputFilterByType DEFLATE application/
   vnd.ms-fontobject AddOutputFilterByType DEFLATE font/opentype font/ttf font/eot
   font/otf </IfModule> # END GzipWpFastestCache # BEGIN LBCWpFastestCache <FilesMatch«\.(
   webm|ogg|mp4|ico|pdf|flv|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff
   |woff2|otf|ttf|svg|eot)(\.gz)?$»> <IfModule mod_expires.c> AddType application/
   font-woff2 .woff2 AddType application/x-font-opentype .otf ExpiresActive On ExpiresDefault
   A0 ExpiresByType video/webm A10368000 ExpiresByType video/ogg A10368000 ExpiresByType
   video/mp4 A10368000 ExpiresByType image/webp A10368000 ExpiresByType image/gif
   A10368000 ExpiresByType image/png A10368000 ExpiresByType image/jpg A10368000
   ExpiresByType image/jpeg A10368000 ExpiresByType image/ico A10368000 ExpiresByType
   image/svg+xml A10368000 ExpiresByType text/css A10368000 ExpiresByType text/javascript
   A10368000 ExpiresByType application/javascript A10368000 ExpiresByType application/
   x-javascript A10368000 ExpiresByType application/font-woff2 A10368000 ExpiresByType
   application/x-font-opentype A10368000 ExpiresByType application/x-font-truetype
   A10368000 </IfModule> <IfModule mod_headers.c> Header set Expires «max-age=A10368000,
   public» Header unset ETag Header set Connection keep-alive FileETag None </IfModule
   > </FilesMatch> # END LBCWpFastestCache
 * # BEGIN redirecciones https
    <IfModule mod_rewrite.c> RewriteCond %{HTTPS} !on
   RewriteRule (.*) [https://%](https://%){HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]
   </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST}
   ^dinosaurios\.tienda$ [NC] RewriteRule ^(.*)$ [https://www.dinosaurios.tienda//$1](https://www.dinosaurios.tienda//$1)[
   R=301,L] </IfModule> # END redirecciones https
 *  Moderador [almendron](https://es.wordpress.org/support/users/almendron/)
 * (@almendron)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177250)
 * Pues si funciona, no lo toques.
 * Una cosa: en el segundo código que te he puesto sobra un `/`
 * Donde pone
 * `RewriteRule ^(.*)$ https://www.dinosaurios.tienda//$1 [R=301,L]`
 * Debería poner:
 * `RewriteRule ^(.*)$ https://www.dinosaurios.tienda/$1 [R=301,L]`
 *  Iniciador del debate [Dram](https://es.wordpress.org/support/users/astromicologist/)
 * (@astromicologist)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177253)
 * Eso decía un profesor mio, si algo funciona «no lo toques» jeje
 * Vale, perfecto, quito una barra.
 * Un millón de gracias por tu ayuda!!!
 *  Moderador [almendron](https://es.wordpress.org/support/users/almendron/)
 * (@almendron)
 * [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177269)
 * De nada. Un saludo.

Viendo 11 respuestas - de la 1 a la 11 (de un total de 11)

 El debate ‘Redirección a https’ está cerrado a nuevas respuestas.

 * En: [Seguridad](https://es.wordpress.org/support/forum/seguridad/)
 * 11 respuestas
 * 2 participantes
 * Última respuesta de: [almendron](https://es.wordpress.org/support/users/almendron/)
 * Última actividad: [hace 6 años, 4 meses](https://es.wordpress.org/support/topic/redireccion-a-https/#post-12177269)
 * Estado: resuelto

## Debates

### Debates populares

### Debates sin respuestas

### Debates que no son soporte

### Debates resueltos

### Debates no resueltos

### Todos los debates
