Hello,
I see your point. The configuration you suggest unfortunately doesn't seem to work.
I also tried other combinations of <Location> or <LocationMatch> and Redirect or RedirectMatch, the only working one is when Redirect is nested in <Location>, as mentioned in Apache docs: https://httpd.apache.org/docs/current/mod/mod_alias.html#redirect. It does not solve the problem though.
RedirectMatch apparently cannot be enclosed in <Location>, at least the documentation doesn't mention such a case: https://httpd.apache.org/docs/current/mod/mod_alias.html#redirectmatch. If I am getting it right, RedirectMatch is interpreted before LocationMatch but due to the fact that it's enclosed inside LocationMatch, the whole block never gets triggered.
However, thanks to the Apache docs and ChatGPT, I've found a workaround which can even be used with the current GUI and Redirect Match type. :-) It makes use of environment variables.
The GUI fields look like this:
It translates into following configuration block in gateway_vhosts.conf:
It is a bit cumbersome, but works well. :-)
As a longer-term solution, perhaps implementing some basic GUI interface for mod_rewrite in addition to mod_alias would be fruitful?
Ivo
I see your point. The configuration you suggest unfortunately doesn't seem to work.
I also tried other combinations of <Location> or <LocationMatch> and Redirect or RedirectMatch, the only working one is when Redirect is nested in <Location>, as mentioned in Apache docs: https://httpd.apache.org/docs/current/mod/mod_alias.html#redirect. It does not solve the problem though.
Code Select
<Location "/one">
Redirect 301 "http://newserver.com/one"
</Location>RedirectMatch apparently cannot be enclosed in <Location>, at least the documentation doesn't mention such a case: https://httpd.apache.org/docs/current/mod/mod_alias.html#redirectmatch. If I am getting it right, RedirectMatch is interpreted before LocationMatch but due to the fact that it's enclosed inside LocationMatch, the whole block never gets triggered.
However, thanks to the Apache docs and ChatGPT, I've found a workaround which can even be used with the current GUI and Redirect Match type. :-) It makes use of environment variables.
The GUI fields look like this:
Local path: /mailman/(?<CUSTOMPATH>.*)
Remote destinations: https://<LIST-SERVER>/mailman/%{env:MATCH_CUSTOMPATH}
It translates into following configuration block in gateway_vhosts.conf:
Code Select
<LocationMatch "/mailman/(?<CUSTOMPATH>.*)">
RedirectMatch 308 "https://<LIST-SERVER>/mailman/%{env:MATCH_CUSTOMPATH}"
</LocationMatch>It is a bit cumbersome, but works well. :-)
As a longer-term solution, perhaps implementing some basic GUI interface for mod_rewrite in addition to mod_alias would be fruitful?
Ivo
"