Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

URL Rewriting Problem

by the3factory 5/10/2008 8:02:00 PM
Question:
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    

 


Answer1:

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.


Answer2:

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


Answer3:

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


Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0