While customizing WebSphere Commerce stores, if you need to provide links to static content deployed on your web server, lets' say for example you need to have a link for size guidelines as shown below:
You will need to make the following changes to httpd.conf:
Where infodocs is a folder you need to create your HTTP server (or any other you see appropriate).
General considerations:
http://<hostname>/infodocs/size_guidelines.htmlTo access this file from Commerce, you will need to use a link which might look as follows:
http://<hostname>/info/size_guidelines
You will need to make the following changes to httpd.conf:
- For VirtualHost 80 and 443. add the following entry
Alias /infodocs "/opt/webserver/assets/infodocs"
- For rewrite rules, add the following line:
RewriteCond %{REQUEST_URI} !^/info.*$
Where infodocs is a folder you need to create your HTTP server (or any other you see appropriate).
General considerations:
- The URL used to access the html file from HTTP server directly can't be identical to the one used by Commerce and that is why I used two different links /infodocs and /info
- For Commerce SEO to work properly you can't use a file extension and that is why I removed .html from the URL
- The Commerce needs to be customized to properly display the content of a static html file. For example, let's assume your SEO will use view CustomStatiContent to handle /info/ and let's assume this view will be rendered using CustomStaticContent.jsp, in such case, this jsp should have some logic that looks as below:
<c:catch var="e">
<c:import var="pageContents" url="${filePath}" charEncoding="UTF-8"/>
</c:catch>
<c:if test="${!empty pageContents && empty e }">
<c:out value="${pageContents}" escapeXml="false"/>
</c:if>
Where filePath variable will hold the following URL (given our example above) http://<hostname>/infodocs/size_guidelines.html
No comments:
Post a Comment