0

我试图缩短这样的 URL:

www.mystore.com/webapp/wcs/stores/servlet/CategoryDisplay?langId=-1& storeId=10001&catalogId=10001&categoryId=10006

...对此:

www.mystore.com/CategoryDisplay?langId=-1&storeId=10001&catalogId=10001& categoryId=10006

使用 IBM 的示例,我只需在 Apache 配置中执行以下操作即可轻松删除大部分 URL:

RewriteRule ^shop/(.*) /webapp/wcs/stores/servlet/$1

然后将其添加到 wc-server.xml 文件中:

<context-root-rewrite value=“/shop” />

是否有可能完全摆脱 /shop/ 前缀?似乎 Apache(又名 IIS)中没有任何东西可以防止这种情况发生,但 Websphere Commerce 会因此而窒息吗?

4

2 回答 2

1

就放

httpd.conf:

 RewriteRule ^/(?!wcsstore)(.*) /webapp/wcs/stores/servlet/$1 [PT,L]

wc-server.xml:

  <SEOConfiguration defaultUrl=""
                    dynamicUrl="true"
                    enable="true">
      <context-root-rewrite value="/" />
  </SEOConfiguration>

重启 server1 和 http 服务器。

于 2016-03-17T17:52:43.507 回答
0

答:因为在这种情况下,我们只是重新路由 servlet 的请求。如果有任何其他内容,就会造成混乱。我们基本上是将一个子分支移动为根的一个子分支,但还有其他子分支。

于 2013-03-12T11:40:38.547 回答