This question is here for visibility only. I have already solved it. Find the answer below.
We setup the following redirect rule, the only redirect rule we had at the time:
RewriteRule "/(.*)(.html)$" "/content/my-company/$1.html" [PT]
As you can see, if I request /en.html
, the rule above should rewrite it to /content/my-company/en.html
.
Here is the issue we were running into:
if I do the following, in-order, here is what I get at every step:
- clear dispatcher cache completely and manually.
- request
https://example.com/en.html
-> returns 404 and the request does not reach the publish server (verified in request.log for publish) - request
https://example.com/content/my-comany/en.html
- success (200). request reaches publish server AND is now cached in dispatcher under pathcache-directory/content/my-comany/en.html
- Now if I request
https://example.com/en.html
from step 1, it returns the page correctly (200). it seems to serve it fro cache?
It seems that dispatcher uses the rewritten url, ONLY if it exists in the dispatcher cache and returns 404 otherwise.