0

i am using WCS7 FEP7. i just enabled seo following below steps.

  1. httpd.conf changes

RewriteRule ^/(.*)$ /webapp/wcs/stores/servlet/$1 [PT,NC]

  1. wc-server.xml changes
<SEOConfiguration  defaultUrl=""  dynamicUrl="true" enable="true">
     <context-root-rewrite value="/"/>
 </SEOConfiguration>

I have run the keyword generation job..All SEO URLs are coming up nice.but OOB ajax calls are failing.

Add to cart ajax calling is failing.. I see http:///AjaxOrderChangeServiceItemAdd Ajax POST call is being triggered.. I am getting 404 error. Where as Commerce server needs http:///webapp/wcs/stores/servlet/AjaxOrderChangeServiceItemAdd

I tried to put a rewrite rule to add 'webapp/wcs/stores/servlet' for this particular request..As this is a POST call (parameters in the body), it would not work properly.

RewriteRule /AjaxOrderChangeServiceItemAdd$ /webapp/wcs/stores/servlet/AjaxOrderChangeServiceItemAdd?data=$1 [NC,L]‹

Am i missing something here.?

Please help.

user3085317
  • 29
  • 2
  • 9

3 Answers3

0

read this below and try it , it is a little different than what you did

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.starterstores.doc/tasks/tsmshortenmadisonsurl.htm

Abed Yaseen
  • 522
  • 4
  • 12
  • It did not help.i have followed same steps. CSS and images are getting loaded correctly.I found another post http://stackoverflow.com/questions/15356244/shortening-the-url-with-rewriterule-remove-content-root-entirely/27551617?noredirect=1#comment43531561_27551617 but there was no clearcut answer mentioned there – user3085317 Dec 18 '14 at 18:23
0

As it's mentioned in http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.starterstores.doc/tasks/tsmshortenmadisonsurl.htm

`If you are specifying a blank context root, use the following format instead:

RewriteEngine on

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

The SEO engine should not care if it's an POST request. Data is sent regardless.

Be sure that you've created your AJAX call from wcf:url

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.component-services.doc/refs/rwvwcfurl.htm

Daniel Persson
  • 602
  • 7
  • 17
  • thanks. the mistake i made was we had a rewrite rule condition. if url contains en-US then RewriteRule ^/(?!wcsstore)(.*) /webapp/wcs/stores/servlet/$1 [PT,L]` end if Here , urls generated from don’t have en-US, hence URL rewrite was not getting executed for them. – user3085317 Jan 14 '15 at 03:39
0

Try this..In the code snipped below, you need to pass your store and catalog ids respectively.

RewriteEngine on
RewriteRule ^/?$ /webapp/wcs/stores/servlet/TopCategoriesDisplay?storeId=<storeId>&catalogId=<catalogId> [L,QSA,PT]
RewriteCond %{REQUEST_URI} !^/robots.txt$
RewriteCond %{REQUEST_URI} !^/sitemap.xml(.gz)?$
RewriteCond %{REQUEST_URI} !^/solr.*$
RewriteCond %{REQUEST_URI} !^/lobtools.*$
RewriteCond %{REQUEST_URI} !^(/)?$
RewriteCond %{REQUEST_URI} !^/webapp.*$
RewriteCond %{REQUEST_URI} !^/wcsstore.*$
RewriteCond %{REQUEST_URI} !^/ConsumerDirectStorefrontAssetStore.*$
RewriteCond %{REQUEST_URI} !^/wps.*$
RewriteCond %{REQUEST_URI} !^/images/.*$
RewriteCond %{REQUEST_URI} !^/favicon\.ico
RewriteRule ^/(.*) /webapp/wcs/stores/servlet/$1?storeId=<storeId>[QSA,PT]
  • Thanks.It is working now..Infact, i am hardcoding storeid,catalogId in rewrite rule as you mentioned. I removed **StoreToken:CatalogToken** from seo url pattern file. – user3085317 Jan 14 '15 at 22:19
  • That is what we generally do handle a contextPath like this. Another thing you can do is to configure a default catalog in CMC. By doing so, you don't need to pass hardcoded catalogId. But yes, hardcoded storeId will still be there in your httpd.conf If this solved your actual problem, please mark it as Correct Answer. That would help others to identify the correct approach. – Ashutosh Srivastav Jan 15 '15 at 08:21