Custom URL "activation"

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
deverill
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Tue Jan 06, 2009 11:58 am
Location: Key West, FL
Contact:

Custom URL "activation"

Post by deverill » Tue Apr 05, 2011 9:58 am

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!
Jim Sewell - Web Programmer
Trusted Tours & Attractions

azar
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Sat Nov 27, 2010 11:43 am

Re: Custom URL "activation"

Post by azar » Tue Apr 05, 2011 10:09 am

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.

User avatar
deverill
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Tue Jan 06, 2009 11:58 am
Location: Key West, FL
Contact:

Re: Custom URL "activation"

Post by deverill » Tue Apr 05, 2011 11:07 am

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Custom URL "activation"

Post by mazhar » Thu Apr 14, 2011 6:50 am

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.

User avatar
deverill
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Tue Jan 06, 2009 11:58 am
Location: Key West, FL
Contact:

Re: Custom URL "activation"

Post by deverill » Mon Apr 18, 2011 7:39 am

Thank you Mazhar! This is something I would never have found on my own.
Jim Sewell - Web Programmer
Trusted Tours & Attractions

azar
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Sat Nov 27, 2010 11:43 am

Re: Custom URL "activation"

Post by azar » Mon May 02, 2011 10:31 am

Thanks Mazhar. The code is working as expected.

Post Reply