WebSphere Commerce DeveloperFeature Pack 7: Deprecated featureFeature Pack 5 or later

Shopper gets a redirection failure

When a shopper tries to write a review and is not logged in, the shopper is prompted to log in. The site does not redirect the shopper back to the write a review section after login.

Problem

WebSphere Commerce fails to redirect the shopper because the host name is being used in the URL. WebSphere Commerce developer allows redirect for localhost by default.

Solution

You can use localhost in the URL request or update WebSphere Commerce configuration to allow for redirection for the system host name. Update the wc-server.xml file to include the AllowedHost element.
  1. WebSphere Commerce DeveloperEdit workspace_dir\WC\xml\config\wc-server.xml
    For example
    <Module 
    contextPath="/webapp/wcs/stores"
    fileServletEnabled="false"
    name="Stores"
    urlMappingPath="/servlet" webAlias="/wcsstore">
    <initParameters
    adapters="XML/HTTP, BrowserAdapter"
    contextSetName="Store" handleDoubleClick="true"/>
    <URLRedirectFilter enable="true">
    <AllowedHost name="hostname.yourdomain.com"/>
    </URLRedirectFilter>
    </Module>
  2. Republish the WebSphere Commerce application.