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.
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!
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 :-)
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
Please could someone give me their thoughts on what I have done wrong? Sorry if I posted in wrong place.
Hi Dean,
Are your image URLs missing a leading slash (/)? That's the only thing that springs to mind at the moment.
Best,
Benjamin
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">» 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
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.
is working on a reply...