Why not simply
Alias "/search-engine" "/var/www/search-engine/dist"
When you want to use AliasMatch
the documentation hints towards:
AliasMatch "^/search-engine(/|$)(.*)" "/var/www/search-engine/dist$1$2"
The first parenthesis match either the file path separator (/
) or the end-of-string.
Next get everything after it. Note that you have to paste these in your directory path with $1
and $2
. This is explained in the documentation:
Alias
will automatically copy any additional part of the URI, past the part that matched, onto the end of the file path on the right side, while AliasMatch
will not. This means that in almost all cases, you will want the regular expression to match the entire request URI from beginning to end, and to use substitution on the right side.
Update
Check the file permissions of /var/www/search-engine/dist/
. Also check whether you have SELinux or AppArmor or similar running and update those profiles if needed.