Copied to clipboard

Flag this post as spam?

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


  • Dean 55 posts 98 karma points
    Aug 26, 2010 @ 01:53
    Dean
    0

    Url Rewriting - tilda no longer finding site root

    Hello everyone at our.umbraco. Your help has been invaluable till now and has got me quite a way through my first umbraco app.

    However, I have hit a snag.

    I have added to the following rewrite rule to UrlRewriting.config:

    <add name="ViewProductReWrite" virtualUrl="^~/View-Product/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/View-Product.aspx?NiceLink=$1" ignoreCase="true" />

    I have enabled flat urls.

    I then created a template, doc and content node called "View Product" (I didn't like having to do that, so if there is a way of doing this without creating that content node please let me know)

    All of the above works, so I can browse to a View Product page and have access to the info I need in the usercontrol to extract the product from my catalogue database.

    The only problem I seem to have created is that on this page sitting within my master template is a login usercontrol. This login control has an image on it and a link on it too. On all other pages where this template is used (all of them) The associated paths of those controls work a treat. But, on my page where the rewrite rule was used the paths are off.

    Correct Path: http://localhost/Images/buttons/login.gif

    Path on rewriten page: http://localhost/View-Product/Images/buttons/login.gif

    Every link on this page has done the same thing despite the fact that everywhere I need a path I have used "~/....." combined with a runat="server". Style sheets linked in the master template have come through fine though.

    I really appreciate any assistance. Umbraco is awesome by the way!

    PS: I am developing using cassinni.

    Thanks

     

     

  • Dean 55 posts 98 karma points
    Aug 30, 2010 @ 00:51
    Dean
    0

    Please could someone give me their thoughts on what I have done wrong? Sorry if I posted in wrong place.

  • Jamie Howarth 306 posts 773 karma points c-trib
    Aug 30, 2010 @ 16:26
    Jamie Howarth
    0

    Hi Dean,

    Are your image URLs missing a leading slash (/)? That's the only thing that springs to mind at the moment.

    Best,

    Benjamin

  • Dean 55 posts 98 karma points
    Aug 31, 2010 @ 00:55
    Dean
    0

    Hi Benjamin, thanks for your assistance.

    Please see the couple of lines below that I have pulled out of the user control where the paths are not being resolved as I expected them to. 

    <a href="~/register--my-account" runat="server" class="FireOrange">&raquo; Register</a>
    <asp:ImageButton ID="LoginButton" runat="server" CommandName="Login" ValidationGroup="ctl00$Login1" ImageUrl="~/Images/Buttons/Login.jpg" />

    As you can see I have referenced the paths with a preceeding ~/ and runat=server.

    These paths are resolved as http://root/register--my-account and http://root/Images/Buttons/Login.jpg on all other pages. But on the page that is captured by the re write rule the paths are http://root/View-Product/register--my-account and http://root/View-Product/Images/Buttons/Login.jpg

    Other paths are all behaving in the same manner (breadcrumbs control etc) on this page. What is strange is that my stylesheets are being  resolved correctly, so my site "looks" correct. Those style sheets are referenced in the head tag of the masterpage.

    I really appreciate your assistance, this is starting to frustrate me now :-)

    regards

    Dean

     

  • Dean 55 posts 98 karma points
    Aug 31, 2010 @ 05:36
    Dean
    0

    Some more info: If I cause a post back on the re-written page, the url in the address bar of the browser changes to

    http://root/view-product.aspx?NiceLink=Cafina-C5-12-Ef-(Schwarz-Black)(4003DMC)

    and the image src and href paths all start working.

     

Please Sign in or register to post replies

Write your reply to:

Draft