DM Classic Scene 7 - Add CSS Extension to /is/content short path and full path urls


CSS files uploaded to AEM Dynamic Media or directly to DM Classic, can be accessed removing the extension from short path urls; when you add the css extension, it shows Image not found, so...

           Found - https://testvipd1.scene7.com/is/content/EAEM/experience-aem

           Not Found - https://testvipd1.scene7.com/is/content/EAEM/experience-aem.css

           Found - https://testvipd1.scene7.com/is/content/EAEM/experience-aem/en/production/css/experience-aem.css



Solution

Following steps add a Ruleset so the CSS files can be accessed with or with out extension and using short or full paths...


1) CSS files uploaded to some location...


2) Following is the Ruleset uploaded to some path eg. /EAEM/rulesets/eaem-css-ruleset

<?xml version="1.0" encoding="UTF-8"?>
<ruleset>
<rule Name="EAEM Full Path CSS URL substitution">
<expression>^(.*)/(.*)\.css$</expression>
<substitution>$2</substitution>
</rule>
<rule Name="EAEM Catalog CSS URL substitution">
<expression>^(.*)\.css$</expression>
<substitution>$1</substitution>
</rule>
</ruleset>


3) Configure the Ruleset file path in Setup > Application Setup > Publish Setup > Image Server > Ruleset Definition File Path


4) Get the origin server url path for testing Setup > Application Setup > General Settings > Origin Server Name


5) With rule set in place the following 3 urls (w/o extension) should return Found

           Found - https://testvipd1.scene7.com/is/content/EAEM/experience-aem

           Found - https://testvipd1.scene7.com/is/content/EAEM/experience-aem.css

           Found - https://testvipd1.scene7.com/is/content/EAEM/experience-aem/en/production/css/experience-aem.css


6) Adding debug_info=ruleset to the url we can see the transformations...




No comments:

Post a Comment