Sitemap & duplicate URL's

Discussion in 'ASP .Net' started by =?Utf-8?B?SmFtZXMgUGFnZQ==?=, Apr 22, 2007.

  1. Does anyone know a way to allow duplicate URL's in a sitemap?

    Here's my problem:

    I'm designing (almost done) an online store with the following navigational
    structure:

    Home / Department / product listing / product detail.

    Each department and product listing have unique pages but the product detail
    is a single page that is given a product ID parameter in the query string.

    All pages are derived from a master page which has the siteMapPath control.

    What I can't do is link from the product listing page to the product detail
    page and show in the siteMapPath were the user has come from i.e.:

    Home / Department / Product list /product detail

    I’m aware that the default sitemap provider won’t allow duplicate URL’s.

    I’d be grateful for some advice!
    =?Utf-8?B?SmFtZXMgUGFnZQ==?=, Apr 22, 2007
    #1
    1. Advertising

  2. You can allow a duplicate URL if you append a querystring parameter to the
    end. It can be a dummy querystring parameter that doesn't do anything.
    For example, the sitemap will see these as two separate pages:
    Default.aspx
    Default.aspx?dummy=1

    --
    I hope this helps,
    Steve C. Orr,
    MCSD, MVP, CSM, ASPInsider
    http://SteveOrr.net



    "James Page" <> wrote in message
    news:...
    > Does anyone know a way to allow duplicate URL's in a sitemap?
    >
    > Here's my problem:
    >
    > I'm designing (almost done) an online store with the following
    > navigational
    > structure:
    >
    > Home / Department / product listing / product detail.
    >
    > Each department and product listing have unique pages but the product
    > detail
    > is a single page that is given a product ID parameter in the query string.
    >
    > All pages are derived from a master page which has the siteMapPath
    > control.
    >
    > What I can't do is link from the product listing page to the product
    > detail
    > page and show in the siteMapPath were the user has come from i.e.:
    >
    > Home / Department / Product list /product detail
    >
    > I’m aware that the default sitemap provider won’t allow duplicate URL’s.
    >
    > I’d be grateful for some advice!
    >
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Apr 23, 2007
    #2
    1. Advertising

  3. =?Utf-8?B?SmFtZXMgUGFnZQ==?=

    James Page Guest

    Steve C. Orr [MCSD, MVP, CSM, ASP Insider] wrote:
    > You can allow a duplicate URL if you append a querystring parameter to
    > the end. It can be a dummy querystring parameter that doesn't do anything.
    > For example, the sitemap will see these as two separate pages:
    > Default.aspx
    > Default.aspx?dummy=1
    >

    Thanks Steve but there'e a problem with this work around

    Say I've got the following pages:

    Default.aspx, page1.aspx, page2,aspx & page3.aspx

    The structure is that the default.aspx links to pages 1 & 2.aspx
    Pages1 & 2 link to page3.aspx.

    The sitemap =

    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

    <siteMapNode url="~/default.aspx" title="Default" >
    <siteMapNode url="~/page1.aspx" title="Page1">
    <siteMapNode url="~/page3.aspx" title="Page 3" />
    </siteMapNode>
    <siteMapNode url="~/page2.aspx" title="Page2" >
    <siteMapNode url="~/page3.aspx?id=2" title="Page 3" />
    </siteMapNode>
    </siteMapNode>
    </siteMap>

    A master page holds the siteMapPath.

    All works fine when you link to page3 from page1 and the siteMapPath
    looks like: default : Page 1 : Page 3

    However when you link from page2 to page 3 the siteMapPath renders the
    same as linking from page1 !

    Also if you amend the first instance of page3.aspx to page3.aspx?id=1
    the siteMapPath won't render at all!

    I've tried all sorts of different combinations without success.

    Thanks

    James
    James Page, Apr 24, 2007
    #3
  4. =?Utf-8?B?SmFtZXMgUGFnZQ==?=

    sureshot

    Joined:
    Dec 14, 2007
    Messages:
    1
    I'm having a very similar problem. Has anyone found a good solution yet?
    sureshot, Dec 14, 2007
    #4
  5. =?Utf-8?B?SmFtZXMgUGFnZQ==?=

    a.oveissian

    Joined:
    Mar 1, 2011
    Messages:
    1
    I know this is an old post but perhaps somebodyelse find my note useful;

    I think master page does not make problem, but if you have pages in separate directories, may see wrong re-direction from page to page because of the current directory that system uses for search may not be root (happens after navigate to sub-directories that contain the aspx page). To avoid this:

    - One of the ways is to use the complete url like following:

    <siteMapNode url="http://localhost:4825/yourwebsiteFolder/default.aspx" title="Main Page" description="Main Page desc" />
    or
    <siteMapNode url="http://www.domain.com/default.aspx" title="Main Page" description="Main Page desc" />


    - Another way is to use referrer to the root ( .. ) while addressing in sitemap:

    <siteMapNode url="../subfoldername/default.aspx" title="Main Page" description="Main Page desc" />


    About duplicates (I know this was not the question), parameters work, fake anchors work as well. exp: default.aspx#nowhere
    Last edited: Mar 1, 2011
    a.oveissian, Mar 1, 2011
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9l?=

    Web.sitemap and target of the URL

    =?Utf-8?B?Sm9l?=, Dec 31, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    13,049
    =?Utf-8?B?bW9uYWhhbjdfNw==?=
    Feb 23, 2006
  2. dtarczynski

    Sitemap and url problem

    dtarczynski, Jul 14, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,842
    dtarczynski
    Jul 14, 2006
  3. AmitKu
    Replies:
    1
    Views:
    792
    Cowboy \(Gregory A. Beamer\)
    Sep 27, 2006
  4. Learner
    Replies:
    5
    Views:
    262
    Dominick Baier [DevelopMentor]
    May 7, 2006
  5. James Page

    Sitemap & duplicate URL's

    James Page, Apr 23, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    108
    James Page
    Apr 23, 2007
Loading...

Share This Page