.htaccess redirigir desde la ubicación anterior

Recently I changed the location of my css file and I want .htaccess to redirect all requests from old location to the new location. This is what I have:

RewriteRule css/^([^/]+)$ /newlocation/css/$1 [L]

for some reason this is not working. What should I do to get it to work. Any help would be appreciated

preguntado el 01 de febrero de 12 a las 04:02

1 Respuestas

You can use this rule in your .htaccess:

RewriteEngine on
RewriteBase /
RewriteRule ^css/([^/]+)$ newlocation/css/$1 [L]

The other alternative, is to create a symbolic link from the root folder (linux os):

ln -s newlocation/css css

this will automatically redirect all request in your CSS to the new location of your CSS without using an .htaccess rule.

Respondido 01 Feb 12, 15:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.