Foros del Web » Administración de Sistemas » Apache »

Un completo: redireccionar index.htm a / y no www a www en http y en https

Estas en el tema de Un completo: redireccionar index.htm a / y no www a www en http y en https en el foro de Apache en Foros del Web. Hola, Antes tenia solo esto en htaccess para rediregir no www a www: # REDIRECT non www to www RewriteCond %{HTTP_HOST} ^marbellasunrentals\.com RewriteRule (.*) http://www.marbellasunrentals.com/$1 ...
  #1 (permalink)  
Antiguo 14/01/2013, 16:59
 
Fecha de Ingreso: mayo-2009
Mensajes: 382
Antigüedad: 14 años, 10 meses
Puntos: 6
Un completo: redireccionar index.htm a / y no www a www en http y en https

Hola,
Antes tenia solo esto en htaccess para rediregir no www a www:
# REDIRECT non www to www
RewriteCond %{HTTP_HOST} ^marbellasunrentals\.com
RewriteRule (.*) http://www.marbellasunrentals.com/$1 [R=301,L]
Tengo un Seo problema y me han dicho que ademas debo rediregir index.htm a /

Ahora el problema, tengo tanto http como https, y tengo un index.htm y 3 index.htm en carpetas un nivel abajo y 2 index en 3 niveles mas abajo.
Me han ayudado a hacer un script, me parecia que iba bien, pero al intentar con un subindex, pues https://www.misitio.com/carpeta/ventas/index.htm fue rediregido a si no me acuerdo mal https://www.misitio.com/ventas/index.htm ya que quité las reglas corriendo, y claro ese archivo no se encuentra alli.
Necesito una regla que redirecciona todas las index.htm y todas no www a www independientemente de la cantidad de niveles hay y que funcione tanto en http como en https.

Esto es lo que tenía y lo he quitado del htaccs:
RewriteEngine On
# REDIRECT htm INDEX PAGES to index/
RewriteRule !index\.htm$ - [S=2]
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*index\.htm[^\ ]*\ H
RewriteRule .? http://www.marbellasunrentals.com/%1? [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*index\.htm[^\ ]*\ H
RewriteRule .? https://www.marbellasunrentals.com/%1? [R=301,L]
# REDIRECT non www to www
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP_HOST} ^marbellasunrentals\.com
RewriteRule (.*) http://www.marbellasunrentals.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^marbellasunrentals\.com
RewriteRule (.*) https://www.marbellasunrentals.com/$1 [R=301,L]

Etiquetas: completo, htaccess, https, redireccionar, rewrite, rewriterule, seo, www
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:19.