Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Kristian Frost 18 posts 102 karma points
    Sep 02, 2013 @ 21:23
    Kristian Frost
    0

    Secret redirect (Product.aspx -> Product.master)

    Hi there.

    I'm just getting started with uCommerce, and stumbled upon a small thing.

    I created a Document Type called Product, with a "matching template". And now, without having set anything up, this Document Type/Template shows up when I click on my product links.

    I haven't created any content (for the Product-page) but somehow this still works. Can anyone explain this to me?

    /Kristian

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Sep 03, 2013 @ 09:39
    Nickolaj Lundgreen
    0

    Im pretty sure thats the standard uCommerce \config\UrlRewriting.config rules (more URLRewrite info here: http://www.iis.net/downloads/microsoft/url-rewrite

  • Kristian Frost 18 posts 102 karma points
    Sep 03, 2013 @ 18:25
    Kristian Frost
    0

    Here is my ~/Config/UrlRewriting.config file:

    <add name="DefaultCategoryProductRewrite" virtualUrl="(.*)/c-([0-9]+)/c-([0-9]+)/p-([0-9]+)"
      rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/shop/product.aspx?catalog=$2&amp;category=$3&amp;product=$4"
      ignoreCase="true" xmlns="" />
    
    <add name="DefaultProductRewrite" virtualUrl="(.*)/c-([0-9]+)/p-([0-9]+)"
      rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/product.aspx?catalog=$2&amp;product=$3"
      ignoreCase="true" xmlns="" />
    
    <add name="DefaultCategoryRewrite" virtualUrl="(.*)/c-([0-9]+)/c-([0-9]+)" 
      rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/shop/catalog.aspx?catalog=$2&amp;category=$3" 
      ignoreCase="true" xmlns="" />
    
    <add name="DefaultCatalogRewrite" virtualUrl="(.*)/c-([0-9]+)"
      rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/shop/catalog.aspx?catalog=$2"
      ignoreCase="true" xmlns="" />
    

    Now, as mentioned in my first post, I don't have any content nodes (yet). I have created a bunch of products in the uCommerce section of Umbraco. The URL I open is this:

    http://localhost/shop/my-product/c-24/p-118
    

    And my Masterpage, which isn't linked to anything else than the matching template, shows up. What I can't figure out is how any of the rewrite rules above can redirect to a page that uses this masterpage/template.

  • Lars Horne-Mortensen 40 posts 184 karma points
    Sep 09, 2013 @ 10:50
    Lars Horne-Mortensen
    0

    Hi Kristian,

    uCommerce only needs two nodes in the content tree, to show the categories and products in a store. Each of the nodes are associated with an URL, and a template, so the redirect rules just take the correct query string parameters, and redirect it to the corresponding aspx page.

    The rewrite rules only look for the last parameters in the URL, ex. "/c-12/c-123/p-111" redirects to "/store/product.aspx?catalog=12&category=123&product=111".

    Hope that clears things up a bit.

    /Lars

Please Sign in or register to post replies

Write your reply to:

Draft