views:

21

answers:

2

I am trying to redirect all the files and sub folders of a folder named scripts which is not in root directory means:

from

http://localhost/(any folder)/(another any folder)/scripts/script.js

to

http://localhost/scripts/script.js

becasue I have placed the scripts folder in the root of the server.

A: 
RewriteEngine on 
RewriteRule /[^/]+/[^/]+/scripts/(.+)$ /scripts/$1 [L]
Spilarix
noo.. you're not getting.. i want to redirect all the files of scripts folder to the original folder which is in the root dir.
Vaibhav Gupta
Like this ? (answer edited)
Spilarix
+1  A: 

What about :

RewriteRule .*/scripts/(.*)$ scripts/$1

?

Matthieu
thx... works gr8...
Vaibhav Gupta