0
votes

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:

  1. clear dispatcher cache completely and manually.
  2. request https://example.com/en.html -> returns 404 and the request does not reach the publish server (verified in request.log for publish)
  3. request https://example.com/content/my-comany/en.html - success (200). request reaches publish server AND is now cached in dispatcher under path cache-directory/content/my-comany/en.html
  4. 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.

1
thank you for sharing with usTim

1 Answers

0
votes

Looking at the adobe docs for dispatcher module here: https://helpx.adobe.com/experience-manager/dispatcher/using/dispatcher-install.html#ApacheWebServerConfigureApacheWebServerforDispatcher

There is an option called DispatcherUseProcessedURL. in our config, it was set to 0 but it should be set to 1 so that the dispatcher module can use the rewritten (processed) url.

That fixed our issue!