in

dashCommerce

An ASP.NET Open Source e-Commerce Application

URL Rewriting and folders with dashcommerce

Last post 06-25-2008 3:43 PM by mattyb. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-25-2008 2:55 PM

    • mattyb
    • Top 150 Contributor
    • Joined on 06-16-2008
    • Posts 9

    URL Rewriting and folders with dashcommerce

    Not sure if anybody else has tried this, but I'm trying to setup my site to work with URLs like the following:

    /Catalog/Category/Name_1.aspx

    When I make modifications to the web.config template settings, I get the following error when I try and navigate to one of these urls:

    Any ideas?

    ********************************************************

    Cannot use a leading .. to exit above the top directory.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

    Source Error:

    Line 85:     /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> to use to render the target-specific output.</param>
    Line 86: protected override void Render(System.Web.UI.HtmlTextWriter writer) {
    Line 87: base.Render(new RewriteFormHtmlTextWriter(writer));
    Line 88: }
    Line 89: }

    Source File: C:\Users\Matt Bertulli\Documents\Visual Studio 2008\Projects\NaturalBundles\Web\ControlAdapter\FormRewriterControlAdapter.cs    Line: 87 

  • 06-25-2008 3:04 PM In reply to

    Re: URL Rewriting and folders with dashcommerce

    You cant do that because of some stuff in App_Themes\dashCommerce\site.skin (maybe other files)
    ASP.NET is going to generate file names with leading .. and because that page is really in the root of the site it errors out

    If you find a way around please let me know

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 06-25-2008 3:08 PM In reply to

    • mattyb
    • Top 150 Contributor
    • Joined on 06-16-2008
    • Posts 9

    Re: URL Rewriting and folders with dashcommerce

    Hey yitzchok,

    I just figured that one out as you posted.

    I moved the images and images/icons out of the App_Themes folder and changed the site.skin file to reference all images by doing a /images/imagename.ext instead of images/imagename.ext.

    My opinion has always been to leave images + css files out of the App_Themes folder, as it's caused me more headache than bliss over the years.

    I've done just that with dashCommerce, moved images and css files out of App_Themes and just left the .skin.

    I've also changed things a bit so the admin can use a seperate theme than the front end, which in my case was easier...

    /matt

  • 06-25-2008 3:22 PM In reply to

    Re: URL Rewriting and folders with dashcommerce

     Does it work now?

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 06-25-2008 3:23 PM In reply to

    • mattyb
    • Top 150 Contributor
    • Joined on 06-16-2008
    • Posts 9

    Re: URL Rewriting and folders with dashcommerce

     Works like a charm if I move the images out of the App_Themes folder.

  • 06-25-2008 3:43 PM In reply to

    • mattyb
    • Top 150 Contributor
    • Joined on 06-16-2008
    • Posts 9

    Re: URL Rewriting and folders with dashcommerce

    My Url's are structured as follows:

    http://localhost:14/Catalog/Category/name_x.aspx

    http://localhost:14/Catalog/Brand/name_x.aspx 

     

    I may try and change things around to be like this for SEO reasons:

    /name_x/catalog/category.aspx

Page 1 of 1 (6 items)