0

Hi I am trying to write an AliasMatch rule to map number of different urls to a single directory location. The goal is to serve all the static content of the application from apache only. I have the static contents scattered all over the application as a result of poor folder structure and it is not possible to change the folder hierarchy as of now. So what i m trying to do is writing an alias match for all the static files and then serve them from apache only. e.g. let say i have .css files at a number of locations in by application like

    wwww.my-app.com/my-app-context/some-random-number/css/first.css
    wwww.my-app.com/my-app-context/some-random-number/some-folder/some-other-folder/css/second.css

now I have placed both first.css and second.css at the apache at following directory location

/apache-root/static-content/css/first.css and
/apache-root/static-content/css/second.css

now want to serve this files from apache only without changing the urls. i have made my uriworkermap.properties as follows

        /app-context=bladeTemp
        /app-context*=bladeTemp
        !/*.css=bladeTemp       

AliasMatch I have used is

    AliasMatch $/(.*)\.css$1 /apache-rootstaticContent/css/$1.css

can some help me to out how to use aliasmatch regex for the above purpose. or should i use mod_rewrite or something else??

1 Answers1

1

try:

AliasMatch ^(.*)\.css$1 /apache-rootstaticContent/css/$1.css

$ is an re identifier meaning 'ends-with' so having this at the start of your RE makes no sense.

RaggaMuffin-420
  • 1,762
  • 1
  • 10
  • 14