Page 1 of 1

Custom URL "activation"

Posted: Tue Apr 05, 2011 9:58 am
by deverill
Hi gang,
I have a program called Sync that populates our store from an external database. I just modified Sync to create a custom URL so Old-Town-Trolley-P37.aspx becomes Old-Town-Trolley.aspx The Sync program writes this directly to ac_CustomUrls table. It works great with one exception... when I sync a new product and then try to navigate to it in the store I get a 404 - Not Found error. If I go into any product in the Administrator side and click on Save then the new product can be found with the custom url.

I have a feeling that it is similar to the 5.0 Rewrite Rules where something has to be activated to go out and re-establish the custom-to-real url conversion but I'm at a loss to find it. Is there a function I can call or something I can do to trigger this 're-mapping' after Sync finishes?

Thanks!

Re: Custom URL "activation"

Posted: Tue Apr 05, 2011 10:09 am
by azar
I have a feeling it is similar to the problem I am facing with redirects. see my post: viewtopic.php?f=42&t=15133

How do you create the custom URL? directly insert in ac_CustomUrls table? Try running SQL profiler and see what queries does Able run when you manually create the custom url.

Re: Custom URL "activation"

Posted: Tue Apr 05, 2011 11:07 am
by deverill
Yes, it does sound like the same type of thing.

I create the custom URL by manipulating the tour name and writing it directly into ac_CustomUrls table. By the way, we are running 7.0.6 currently.

Re: Custom URL "activation"

Posted: Thu Apr 14, 2011 6:50 am
by mazhar
This seems cache issue to me. We are using cache with redirects. When you add a redirect from admin panel then it forces the cache to reload it self. In your case you are directly working on database so cache is still old. At the moment there is no interface to clear URL cache. You need to do the following thing

Go to Website/Admin/Seo/Settings.aspx page and add one button to it and call it Clear Cache or something. Then upon its click event add following code

Code: Select all

CommerceBuilder.Seo.IRedirectService service = CommerceBuilder.Seo.RedirectServiceLocator.Instance;
if (service != null) service.ReloadCache();
Now when you are done doing inserts in database you need to clear URL cache and test the URLs. Hopefully they will be working.

Re: Custom URL "activation"

Posted: Mon Apr 18, 2011 7:39 am
by deverill
Thank you Mazhar! This is something I would never have found on my own.

Re: Custom URL "activation"

Posted: Mon May 02, 2011 10:31 am
by azar
Thanks Mazhar. The code is working as expected.