En mi archivo .htaccess tengo una regla con condición que me redirige las peticiones según el idioma predeterminado del navegador del usuario. Para eso tengo lo siguiente:
Código:
Supuestamente esta regla redirecciona una petición colocándole el prefijo "en/" o "es/" según corresponda. El problema es que no es ese el resultado, me redirecciona a una dirección en mi sistema de archivos y no a una dirección de servidor. Para dar un ejemplo: si escribo en la barra de direcciones: RewriteCond %{HTTP:Accept-Language} es.* [NC] RewriteRule .* es/$1 [L,NC,R=301] RewriteCond %{HTTP:Accept-Language} en.* [NC] RewriteRule .* en/$1 [L,NC,R=301]
http://localhost/misitio/imagenes/logo.jpg
me redirecciona a
http://localhost/C:/Program%20Files%...genes/logo.jpg
obviamente no es lo que quiero, sino:
http://localhost/misitio/es/imagenes/logo.jpg
Dejo por si sirve el resultado del rewrite.log:
Código:
Si alguien sabe cómo solucionarlo, o tiene alguna idea para probar, se lo agradezco mucho. 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (3) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] applying pattern '(.*)' to uri 'imagenes/logo.jpg' 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (4) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] RewriteCond: input='en-US,en;q=0.8' pattern='es.*' [NC] => not-matched 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (3) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] strip per-dir prefix: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/imagenes/logo.jpg -> imagenes/logo.jpg 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (3) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] applying pattern '(.*)' to uri 'imagenes/logo.jpg' 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (4) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] RewriteCond: input='en-US,en;q=0.8' pattern='en.*' [NC] => matched 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (2) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] rewrite 'imagenes/logo.jpg' -> 'en/imagenes/logo.jpg' 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (3) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] add per-dir prefix: en/imagenes/logo.jpg -> C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/en/imagenes/logo.jpg 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (2) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] explicitly forcing redirect with http://localhost/C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/en/imagenes/logo.jpg 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (1) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] escaping http://localhost/C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/en/imagenes/logo.jpg for redirect 127.0.0.1 - - [05/Dec/2010:15:48:17 --0200] [localhost/sid#fa3140][rid#3d8a140/initial] (1) [perdir C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/misitio/] redirect to http://localhost/C:/Program%20Files%20(x86)/Apache%20Software%20Foundation/Apache2.2/htdocs/misitio/en/imagenes/logo.jpg [REDIRECT/301]
Saludos!