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

问题描述 投票:0回答:1

目前我工作的客户正在使用此处概述的 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>

当我这样做时,我确实看到生成的 URL 现在省略了

/en/clientstorename
,但是每个页面都只显示一条通用错误消息,甚至将日志记录一直调到
*=all
在控制台中也没有显示任何内容。

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

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

在不影响网站本身功能的情况下,从客户网站上的每个网址中删除此 /en/clientstorename 的最佳方法是什么。

java url seo websphere websphere-7
1个回答
0
投票

在WebSphere Commerce 7 中,管理SEO URL 涉及在WebSphere Commerce 管理中心中配置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.
© www.soinside.com 2019 - 2024. All rights reserved.