Logo Linux Bash SSH Ubuntu Git Menu
 

Apache: combine two AliasMatch statements into one

Could be the following AliasMatch statements for Apache 2.4 combined into one?

AliasMatch ^/([0-9]{6})$ /var/www/data/$1
AliasMatch ^/([0-9]{6})/(.*)$ /var/www/data/$1/$2
like image 228
Neurotransmitter Avatar asked Apr 03 '26 03:04

Neurotransmitter


1 Answers

BillThor only forgot to add the *s in the patterns. Either:

AliasMatch ^/([0-9]{6}(/.*)?)$ /var/www/data/$1

or

AliasMatch ^/([0-9]{6})((/.*)?)$ /var/www/data/$1$2

The first for preference.

like image 117
Unbeliever Avatar answered Apr 04 '26 20:04

Unbeliever