We have some urls in cq5 which doesn't have extensions(.html - done through vanity urls). The Apache dispatcher is not caching these pages, plz suggest on this.
Regards,
Susheel
Solved! Go to Solution.
It just happens, I do. I'll link to my blog post describing the approach in more detail. But, the main gist is that you use the Apache web server to "hide" the fact that AEM (technically Sling) requires an extension on every request. In Apache you 301 redirect every version of a url (ends in .html or ends in no slash) to the version that ends with a slash. Then you use a pass-through rewrite rule that adds replaces that trailing / with a ".html" as it passes the request back through the dispatcher to AEM. The pass-through rule makes this happen without the user ever knowing it, because it doesn't change the browser URL.
Note: It is important to 301 redirect requests that end in .html and no slash to the request with the slash, then again add the .html with the pass-through rule. It sounds like extra work, but it isn't. The reason is that you don't want Google to be able to index multiple URLs to the same content. You'll get penalized in terms of SEO, because Google will think you are trying to do something nasty.
Here's the full article. I hope it helps:
http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-adobe-experience-manager.html
Views
Replies
Total Likes
Dispatcher does not cache pages that do not have an extension. I don't know of any way around this.
scott
Views
Replies
Total Likes
Does someone have a working approach to solve this question?
I have the very same problem in here.
Regards
Views
Replies
Total Likes
I just got know its workaround: We can have extension less urls and just add the .html extension in the apache rewrite module.
This is something needs to be checked, once I do this then I'll confirm here.
Thanks
Susheel
It just happens, I do. I'll link to my blog post describing the approach in more detail. But, the main gist is that you use the Apache web server to "hide" the fact that AEM (technically Sling) requires an extension on every request. In Apache you 301 redirect every version of a url (ends in .html or ends in no slash) to the version that ends with a slash. Then you use a pass-through rewrite rule that adds replaces that trailing / with a ".html" as it passes the request back through the dispatcher to AEM. The pass-through rule makes this happen without the user ever knowing it, because it doesn't change the browser URL.
Note: It is important to 301 redirect requests that end in .html and no slash to the request with the slash, then again add the .html with the pass-through rule. It sounds like extra work, but it isn't. The reason is that you don't want Google to be able to index multiple URLs to the same content. You'll get penalized in terms of SEO, because Google will think you are trying to do something nasty.
Here's the full article. I hope it helps:
http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-adobe-experience-manager.html
Views
Replies
Total Likes
Hi Susheel,
Did you had any luck on this. We are also having the same issue and I was able to do a apache workaround on the URL, but its still not caching as the HTTP_HEADER still holds the main url (without the extension).
Thanks,
Annamalai
Views
Replies
Total Likes
It will work. Verify the configuration for DispatcherUseProcessedURL
Hi Sham,
It didn't work. This is my dispatcher configuration, still not able to see extensionless files are cached.
<IfModule disp_apache2.c>
DispatcherConfig conf.d/dispatcher.any
DispatcherLog logs/dispatcher.log
DispatcherLogLevel 3
DispatcherNoServerHeader 0
DispatcherDeclineRoot 1
DispatcherUseProcessedURL 1
DispatcherPassError 0
</IfModule>
Apache Rule:
RewriteRule ^/(.*)$
/$1.html [PT]
Rewrite log in apache says its properly rewrite the url to include .html to the file.
Views
Replies
Total Likes
Hi, Annamalai
I know this post it a little bit old, but I like to come back and add the solution whenever I find one ;)
I got it working with a configuration very similar to yours: DispatcherUseProcessedURL set to "1", and RewriteRule with he [PT] flag set.
But two things still needs attention:
Views
Replies
Total Likes
Hi, Annamalai
I know this post it a little bit old, but I like to come back and add the solution whenever I find one ;)
I got it working with a configuration very similar to yours: DispatcherUseProcessedURL set to "1", and RewriteRule with he [PT] flag set.
But two things still needs attention:
I hope this helps, at least someone that may read this topic in the future.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies