0

I working with a website with a structure much like the following:

|-- module1
||-- www
|||-- js
|||-- module1.php
|-- module2
||-- www
||| -- js
||| -- css
|||-- module2.php
|-- www
||-- js
||-- images

The docroot points to /www and, /module1/www are outside the docroot and I have to serve it this way: /module1/js

At the beggining, we had static aliases to have this working:

Alias /module1 /module1/www

But nowadays, we have a lot of modules (70+) and all these aliases are just insane. Trying to solve this, we developed this AliasMatch rule:

AliasMatch ^/(.*)/\1\.php(.*)$ D:/WCs/system/$1/www/$1.php$3

It partially worked, because the moduleX.php work as a route to most important files, but when we want something that doesn't follow this pattern, everything crashes (just think about a file inside the js directory or an ordinary file). And we cannot map everything, because we have files like global css and js in the /www directory.

So, I came to ask for help. I think that mod_rewrite would not suit here, because, as I see, it works just with files inside the docroot, correct? How would you solve this problem? Maybe with custom .htaccess files inside the /moduleX/www to remap as needed?

By the way, I'm using apache 2.2 and mod_alias. Thank you.

Gardner
  • 112
  • 12

0 Answers0