36

Currently the client I'm working for is making use of the SEO Friendly urls outlined here:

https://www.ibm.com/support/knowledgecenter/en/SSZLC2_8.0.0/com.ibm.commerce.seositemap.doc/concepts/csdSEOURLconstruction.htm

However, they would like to have /en/clientstorename removed from all urls. For example, when a user navigates to www.clientwebsite.com, the url automatically switches over to www.clientwebsite.com/en/clientstorename. I would like to remove the /en/clientstorename from the url, and all other urls on the site.

The client has also informed me that IHS changes are not a possible solution to this problem.

So, to my knowledge, that leaves me with the single option of directly removing the /LanguageToken/StoreToken:CatalogToken parts from all entries in each SEOURLPatterns xml file. That is to say, my thinking was make this change throughout all SEOURLPatterns xml files in the workspace. (Note the commented out existing line and my uncommented modified line)

<seourl:seoUrlPatternDef name="PersonalizedProductURLPIPPage">
<!--<seourl:seoUrlPattern viewName="ThirdPartyVendorProductsDisplayView">/LanguageToken/StoreToken:CatalogToken/ProductToken/PCPToken/BeginIndexToken/ioZoneToken</seourl:seoUrlPattern>-->
    <seourl:seoUrlPattern viewName="ThirdPartyVendorProductsDisplayView">/ProductToken/PCPToken/BeginIndexToken/ioZoneToken</seourl:seoUrlPattern> 
    <seourl:urlToParamMapping>
        <seourl:mapping name="langId" value="?LanguageToken?"/>
        <seourl:mapping name="storeId" value="?StoreToken?"/>
        <seourl:mapping name="catalogId" value="?CatalogToken?"/>
        <seourl:mapping name="productId" value="?ProductToken?"/>
        <seourl:mapping name="plchldr" value="?PCPToken?"/>
        <seourl:mapping name="mfname" value="?BeginIndexToken?" />
        <seourl:mapping name="styleId" value="?ioZoneToken?" />
        <seourl:mapping name="errorViewName" value="ProductDisplayErrorView"/>
    </seourl:urlToParamMapping>
    <seourl:paramToUrlMapping>
        <seourl:mapping name="LanguageToken" value="?langId?" defaultValue="-1"/>
        <seourl:mapping name="StoreToken" value="?storeId?"/>
        <seourl:mapping name="CatalogToken" value="?catalogId?"/>
        <seourl:mapping name="ProductToken" value="?productId?"/>
        <seourl:mapping name="PCPToken" value="?plchldr?"/>
        <seourl:mapping name="BeginIndexToken" value="?mfname?"/>
        <seourl:mapping name="ioZoneToken" value="?styleId?"/>
    </seourl:paramToUrlMapping>
    <seourl:usageDef>
        <seourl:usage device="browser">
            <seourl:target>CatalogEntry</seourl:target>
        </seourl:usage>
    </seourl:usageDef>
</seourl:seoUrlPatternDef>

When I do this, I do see that the URLs generated are now leaving out the /en/clientstorename, however every page just shows a generic error message, and even turning the logging up all the way to *=all shows nothing in the console.

I'm kind of stuck here and not sure how to proceed. Is there a class somewhere that I can hijack in order to get these parts of the SEO urls removed? When I remove the /en/clientstorename using the SEOURLPatterns.xml files, there are undocumented exceptions being thrown and I'm unsure how to proceed down that route.

I have also tried to intercept and remove the /en/clientstorename from the URL inside of the SEOURLMapper class, but my testing with this didn't actually affect the URL displayed in the browser.

What is the best way of removing this /en/clientstorename from each url on my client's site without affecting the functionality of the site itself.

jros
  • 714
  • 1
  • 10
  • 33
  • 1
    question: Are you looking for a solution where URLs just end up getting redirected to an SEO-friendly canonical URL or a solution where the URLs that are generated on the webpages themselves are the SEO-friendly canonical URLs? – entpnerd Jul 27 '18 at 02:59
  • did you try: https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.seositemap.doc/concepts/csdSEOpatternfiles.htm – DeerSpotter Aug 01 '18 at 20:29
  • also here is a great resource: https://www.scribd.com/document/281070301/searchengineoptimizationseo-130820015428-phpapp02 – DeerSpotter Aug 01 '18 at 20:31
  • enable more detailed logging and tracing in your WebSphere Application Server – DimaSan Jan 26 '23 at 23:01
  • Why the Java tag? Also the link you shared points to a page that only says this product is no longer supported. – aled Aug 28 '23 at 00:17

0 Answers0