I'm trying to set up apache with an alias with and rewrite rules.
I have rewrite set up to forward all requests to index.php. That works great.
My issue is with setting up the AliasMatch for some specific locations.
If the client browses to /core/plugins/<plugin_name>/client
, I want the alias to map the directory to /var/www/example.com/src/plugins/<plugin_name>/client
on the server
The plugin name is variable and may or may not exist.
Here is my apache vhost config:
ServerName example.com
DocumentRoot /var/www/example.com/src/public
AliasMatch ^/core/plugins/(.+)/client /var/www/example.com/src/plugins/$1/client
<Directory /var/www/example.com/src/public>
Require all granted
Options -Indexes
AddDefaultCharset UTF-8
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,PT]
RewriteBase /
</Directory>
When I browse to /core/plugins/plugin1/client/style.css
, the file served should theoretically be /var/www/example.com/src/plugins/plugin1/client/style.css
, but instead I just get a redirect loop that adds /index.html
repeatedly until my browser hangs for too many redirects. I'm not even referencing index.html
in my config.