Expand my Community achievements bar.

SOLVED

Dispatcher Serves the Cached content only

Avatar

Level 4

I am trying to access the Geometrixx URL from the Dispatcher Server

 

When I make the first request to the page 

http://localhost:8087/content/geometrixx-outdoors/en.html I see the page and HTML is cached.

 

When I delete the cached copy and try to hit http://localhost:8087/ I get:

 The requested URL /content/geometrixx-outdoors/en.html was not found on this server.

 

So unless the /en.html copy is cached, I cannot see the page.

 

Following are the Rewrite URL and dispatcher settings I am using:

 

<VirtualHost *:8087>

 DocumentRoot /Library/WebServer/Documents

 RewriteEngine On

 RewriteRule ^/$ /content/geometrixx-outdoors/en.html [PT]

 RewriteCond %{REQUEST_URI} !^/apps/(.*) [NC]

 RewriteCond %{REQUEST_URI} !^/etc(.*) [NC]

 RewriteCond %{REQUEST_URI} !^/libs(.*) [NC]

 RewriteCond %{REQUEST_URI} !^/content(.*) [NC]

 RewriteCond %{REQUEST_URI} !^/system(.*) [NC]

 RewriteCond %{REQUEST_URI} !^/dam(.*) [NC]

 RewriteCond %{REQUEST_URI} !^/searchservice(.*) [NC]

RewriteCond %{REQUEST_URI} !^/store(.*) [NC]

 RewriteCond %{REQUEST_URI} !^/services(.*) [NC]

 RewriteRule ^/(.*) /content/corp/en_us/$1 [PT] 

 

</VirtualHost>

 

  /0023 { /type "allow" /url "/content*" }  # disable this rule to allow mapped content only

 

On the Dispatcher log : when I try to access en.html which is not cached , I see

  request URL has no extension: /

cache-action for [/]: NONE

Filter rejects: GET / HTTP/1.1

 

I could not understand if dispatcher rejects the request (http://localhost:8087/) when page is not cached, why or how would it serve the page when it is cached?

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can have the filter in dispatcher.any  [0] but it open access to all types and security risk is involved. 

Workaround would be either use [R] Or you can use Directory. In dispatcher.conf comment out [1] and add [2]. Let me know if issue resolve at your end by adding [2].

 

[0] { /type "allow" /glob "*/*" }


[1] RewriteRule ^(/)$ /content/geometrixx-outdoors/en.html [R]

[2]
<Directory "<cachedirectorypath>/htdocs">
RewriteEngine on
RewriteRule ^()$ /content/geometrixx-outdoors/en.html [PT]
</Directory>

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

You can have the filter in dispatcher.any  [0] but it open access to all types and security risk is involved. 

Workaround would be either use [R] Or you can use Directory. In dispatcher.conf comment out [1] and add [2]. Let me know if issue resolve at your end by adding [2].

 

[0] { /type "allow" /glob "*/*" }


[1] RewriteRule ^(/)$ /content/geometrixx-outdoors/en.html [R]

[2]
<Directory "<cachedirectorypath>/htdocs">
RewriteEngine on
RewriteRule ^()$ /content/geometrixx-outdoors/en.html [PT]
</Directory>

Avatar

Level 4

Thanks for the suggestion ,  when I add the <Directory "/Library/WebServer/Documents/htdocs"> and tried to restart the server I see syntax errors. 

 

If I comment out [1] and add the rewrite url rule [2]  in the <VirtualHost *:8087> I see :  The requested URL /content/corp/en_us/ was not found on this server.