doubts on dispatcher cache and mod rewrite
I've configured Sling mapping in publish instance and its working fine.
{ "jcr:primaryType": "sling:OrderedFolder", "home": { "sling:internalRedirect": "/content/geometrixx/en.html", "sling:match": "localhost.4503/$", "jcr:primaryType": "sling:Mapping", }, "localhost.4503": { "sling:internalRedirect": "/content/geometrixx/en", "jcr:primaryType": "sling:Mapping", "redirect": { "sling:internalRedirect": [ "/content/geometrixx/en/$1", "/$1" ], "sling:match": "(.+)$", "jcr:primaryType": "sling:Mapping", } } }I'm trying to access through dispatcher. I'm using Apache 2.0 on windows 7, CQ5.6.0. My httpd.conf looks like below -
<IfModule disp_apache2.c> DispatcherConfig conf/dispatcher.any DispatcherLog logs/dispatcher.log DispatcherLogLevel 3 DispatcherNoServerHeader 0 DispatcherDeclineRoot 0 DispatcherUseProcessedURL 0 DispatcherPassError 0 </IfModule> <VirtualHost *:80> ServerName localhost DocumentRoot "C:/Apache2/htdocs/content/sitea" RewriteEngine On RewriteRule ^/$ /content/geometrixx/en.html [PT,L] RewriteCond %{REQUEST_URI} !^/apps RewriteCond %{REQUEST_URI} !^/content RewriteCond %{REQUEST_URI} !^/etc RewriteCond %{REQUEST_URI} !^/home RewriteCond %{REQUEST_URI} !^/libs RewriteCond %{REQUEST_URI} !^/tmp RewriteCond %{REQUEST_URI} !^/var RewriteRule ^/(.*)$ /content/geometrixx/en/$1 [PT,L] <Directory "C:/Apache2/htdocs/content/sitea"> <IfModule disp_apache2.c> SetHandler dispatcher-handler ModMimeUsePathInfo On </IfModule> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory> </VirtualHost>Q1) Now, when I hit : localhost/content/geometrixx/en/products.html then I get the page and dispatcher also cache the page. But after if I navigate to any page for example Products ->Triangle then URL becomes localhost:4503/products/triangle.html due to Sling mapping. is this expected? As dispatch does not know about Sling mapping hence it does not cache triangle.html. How to make dispatcher cache work?
Q2) As the rewriter rule is there(RewriteRule ^/(.*)$ /content/geometrixx/en/$1 [PT,L]), if I hit this url localhost/triangle.html then I should get the proper page as localhost/content/geometrixx/en/triangle.html but I get 404 error.
Kindly let me know what I'm missing here.