Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/01/2013, 16:59
helenp
 
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]