Hi,
We have a requirement to remove .html from end user urls while retaining cacheability.
The approach which we followed is
RewriteCond %{REQUEST_FILENAME} !.
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{HTTP_ACCEPT} ^.html.$
RewriteRule ^([^.][^./]) # .)?$ $1.html$2 [PT,QSA]
The issues which we are facing are
for example thesetype of rules are not working RewriteRule ^/(.*)$ /content/mycompany/amer/us/en/xyz/$1 [PT]
Is there a way to achieve stripping html for few sites and retain for others without checking option Strip HTML Extension under Day CQ Link Checker Transformer in Felix console?
Any help on this is highly appreciated.
Thanks & Regards,
Srikanth Pogula
Solved! Go to Solution.
Hi,
in my experience, if you need to rewrite the outcoming links in order to strip the extension and then cache the page with the extension in order to use the standard configuration of the flush Agent, you just only need to apply the strip configuration from the Link Checker Transformer configuration and apply a rewrite at the apache level in order to add the .html extension for the incoming request.
In that way the extension is applied in the cache and you don't need to change nothing into the Flush Agent.
Let me know if you need some other info.
Thanks,
Antonio
Could you explain your requirements/use case that you're trying to achieve?
Technically it could be done but it depends on your use case and your setup.
Views
Replies
Total Likes
Hi Gaurav,
The goal is to have html free urls in our application and cache needs to be created and it must be auto flushed when content is activated.
Any pointers would be helpful.
Views
Replies
Total Likes
There are several solutions but that depends on your "requirements". You'll find a lot of threads in this forum itself -
You'd have to do a lot of custom effort to strip .html in web server then map it back to content using sling mappings for sling to resolve it. Post that, you'd have to write custom flush agents to manipulate the path where you plan to utilize it.
couple of links:
Removing .html extension at dispatcher, sling:mapping, and vanity URLs conflict
apache - Strip HTML extension from outgoing URL - Stack Overflow
Views
Replies
Total Likes
Hi,
in my experience, if you need to rewrite the outcoming links in order to strip the extension and then cache the page with the extension in order to use the standard configuration of the flush Agent, you just only need to apply the strip configuration from the Link Checker Transformer configuration and apply a rewrite at the apache level in order to add the .html extension for the incoming request.
In that way the extension is applied in the cache and you don't need to change nothing into the Flush Agent.
Let me know if you need some other info.
Thanks,
Antonio
Views
Likes
Replies
Views
Likes
Replies