This is in the configuration file of "this.com":
RedirectMatch 301 ^/dham/(.*)$ http://other.com/dham/$1
Server is restarted. Then I curl an address that should match:
~$ curl http://this.com/dham/abc
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
Why doesn't it work? And yes, the server reads this config file (I confirmed this by deliberately misspelling the directive, which caused an error on restart). I would have expected a redirect message.
[EDIT] This simpler approach also doesn't work:
Redirect 301 /dham http://other.com/dham
Further working straight from the documentation. This works even less, the server doesn't start and gives an error message about a missing target URL. The documentation clearly shows that within a location block, only the target URL is required (because the source is of course known from the Location). I'm running Apache 2.4.
<Location "/dham">
Redirect 303 "http://other.com/dham"
</Location>