Mobile app version of vmapp.org
Login or Join
Murray432

: Why is AliasMatch not working? Here is what we have: Alias /assets/ "/home/virtual/public_assets/" AliasMatch ^/~([a-zA-Z0-9]+)/assets/(.*)$ /home/virtual/public_assets/ <Directory "/home/virtual/public_assets">

@Murray432

Posted in: #Apache

Here is what we have:

Alias /assets/ "/home/virtual/public_assets/"
AliasMatch ^/~([a-zA-Z0-9]+)/assets/(.*)$ /home/virtual/public_assets/

<Directory "/home/virtual/public_assets">
AllowOverride All
</Directory>


Here is the URI we are trying to match to:

/~admin30/assets/js/tests.js


The Alias directive works for our live sites, however, the AliasMatch which is supposed to match user directories does not.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray432

2 Comments

Sorted by latest first Latest Oldest Best

 

@Moriarity557

I have tested your configuration and it works fine on a clean Apache install. It is possible you have other conflicting configuration somewhere.

I would also test it with a single user in the AliasMatch directive rather than the generic pattern you currently have. Like this:


AliasMatch ^/~admin30/assets/(.*)$ /home/virtual/public_assets/


Also if you could describe what does actually happens it might help. If you get an error, check the Apache error log and show us any relevant entries.

10% popularity Vote Up Vote Down


 

@Radia820

I suspect that you need to put your AliasMatch directive before the alias directive. I think it works best to have the most specific paths first.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme