在Websphere Commerce 7中,如何以正确的方式从SEO URL中删除语言和商店名称?

jro*_*ros 13 java url websphere seo websphere-7

目前我正在工作的客户正在使用此处概述的SEO友好网址:

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

但是,他们希望/en/clientstorename从所有网址中删除.例如,当用户导航到www.clientwebsite.com时,该URL会自动切换到www.clientwebsite.com/en/clientstorename.我想删除/en/clientstorename网址上的网址以及网站上的所有其他网址.

客户还告诉我,IHS更改不是解决此问题的可能方法.

所以,据我所知,这使得我可以直接从每个SEOURLPatterns xml文件中的所有条目中删除/ LanguageToken/StoreToken:CatalogToken部分.也就是说,我的想法是在工作区中的所有SEOURLPatterns xml文件中进行此更改. (注意注释掉的现有行和我未注释的修改行)

<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>
Run Code Online (Sandbox Code Playgroud)

当我这样做时,我确实看到生成的URL现在已经遗漏了/en/clientstorename,但是每个页面只显示一般错误消息,甚至将记录一直转到*=all控制台中没有显示任何内容.

我有点被困在这里,不知道如何继续.是否有一个类我可以劫持的类,以便删除这些SEO网址的部分?当我使用SEOURLPatterns.xml文件删除/ en/clientstorename时,会抛出未记录的异常,我不确定如何继续沿着该路由行进.

我还尝试拦截并从SEOURLMapper类中的URL中删除/ en/clientstorename,但我的测试实际上并没有影响浏览器中显示的URL.

从客户端站点上的每个URL中删除此/ en/clientstorename的最佳方法是什么,而不会影响站点本身的功能.

小智 -1

在WebSphere Commerce 7 中,管理SEO URL 涉及在WebSphere Commerce Management Center 中配置URL 模式和设置。要从 SEO URL 中删除语言和商店名称,您通常需要调整 URL 模式和设置。以下是有关如何实现此目标的一般指南:

Access the Management Center:
    Log in to the WebSphere Commerce Management Center.

Navigate to SEO Configuration:
    In the Management Center, go to the "Merchandising" tab.
    Under "Search Engine Optimization (SEO)," select "SEO Configuration."

Modify URL Patterns:
    Find the section that allows you to configure SEO URL patterns.
    Look for patterns related to language and store name in URLs.
    Modify the URL patterns to exclude the language and store name. You might need to use a pattern like /{category}/{product} without including language or store name placeholders.

Update Store URL Settings:
    Go to "Stores" in the Management Center.
    Select your store and navigate to the "Store URL and SEO" section.
    Check for any settings related to including language or store name in URLs and disable them.

Rebuild and Publish:
    After making changes, rebuild and publish your store to apply the new URL configurations.
    This process ensures that the changes take effect on the live site.

Test URLs:
    After making changes and publishing, test the URLs to ensure that language and store name are no longer included.
Run Code Online (Sandbox Code Playgroud)