views:

25

answers:

2

As we build and demo sites on our staging server with individual root folders for each such as /CLIENTNAME, we need to keep all the css, js and internal links for these sites referencing the server root.

The following works for one folder each, but not sure how to adapt to work for all folders.

Currently

AddHandler php5-script .php

RewriteEngine On

RewriteRule ^(images|css|js)\/(.*) /ONEFOLDER/$1/$2

Would like

AddHandler php5-script .php

RewriteEngine On

RewriteRule ^(images|css|js)\/(.*) /EVERYFOLDER/$1/$2

Many thanks in advance.

A: 

I don't think that's possible unless you can detect, based on the URL, what client it is (it would have to be in the name), and that is what you're trying to avoid.

.htaccess is made to manipulate paths, not to create seemingly "random" new ones.

I think your single path thing will work the best.

Kerry
A: 

Thanks that makes sense.

Gavin Hall