URL Rewriting Problem

Rate It (1)

Last post 05-06-2008 7:02 AM by srulyt. 3 replies.

Sort Posts:

  • URL Rewriting Problem

    05-06-2008, 5:32 AM
    • Loading...
    • dumin
    • Joined on 10-31-2006, 1:09 AM
    • CMB, Sri Lanka
    • Posts 8
    Hi all I had issue in URL Rewritng using  an HttpModule .I have create a userfriendly url for this urlhttp://www.mydomain.com/ladies-fragrance.aspx?productcategoryid=103&productsubcategoryid=0&ipb=1&brandlist=1 to http://www.mydomain.com/ladies-fragrance/adidasbut I had a problem the images are not working and also the hyperlinks are not working because the each and every hyperlink goes as followshttp://www.mydomain.com/ladies-fragrance/test.html  but the link should be http://www.mydomain.com/test.htmlneed a help to solve this issue ASAP    

     

  • Re: URL Rewriting Problem

    05-06-2008, 6:09 AM

    It looks like you are using relative URL's, either fully resolve your URL's or use the ~ character to get to the root of your site e.g.

    Your links look like this:

    <a href="test.html">Test</a>

    Change to:

    <a href="http://www.mydomain.com/test.html">Test</a>

    or

    <asp:HyperLink ID="HyperLink1" NavigateUrl="~/test.html" runat="server">Test</asp:HyperLink>

     Do the same with your images as well.

    --------------------------------------------------------
    Don't forget to click "Mark as Answer" on the post(s) that helped you.

    Scott ASP.net blog

  • Re: URL Rewriting Problem

    05-06-2008, 6:34 AM
    • Loading...
    • dumin
    • Joined on 10-31-2006, 1:09 AM
    • CMB, Sri Lanka
    • Posts 8

    rather than giving fully qualified url to hyperlink ex < a href="http://www.test.com/test.aspx></a> is there any solution? becuase html controls not accpeting '~' . '~' can use for asp.net controls . requried a reply asap

  • Re: URL Rewriting Problem

    05-06-2008, 7:02 AM
    • Loading...
    • srulyt
    • Joined on 02-02-2008, 1:16 PM
    • Posts 200

    you can use a base tag <Base href=http://www.mytest.com />

    you can also make your own cusotm hyperlink control that uses your URL rewriting logic to create the appropriate links

Page 1 of 1 (4 items)