I am using Intelligencia for url rewirting. My problem开发者_运维问答 is after url rewirting images and scripts lost becuase its urls changes.
<rewrite url="~/Pages/(.+).html" to="~/Default.aspx?PageId=$1"/>
if i remove pages from pattern it work correctly(like below)
<rewrite url="~/(.+).html" to="~/Default.aspx?PageId=$1"/>
You have to generate the links that are the same format after rewrite. AFAIK, the Intelligencia only rewrite the urls the come to server not the actual ones in your pages.
You need to use a HTML BASE
tag to re-center all your relative paths on the rewritten page to the correct path. This BASE
tag will be pointing to the un-rewritten version of the URL.
For an example of this exact example click here. This page is rewritten and uses Intelligencia's URL Rewriter as well. View the source of that page and you'll notice that the physical file path is given with the BASE
tag: <base href="http://www.igougo.com/travelcontent/JournalDestination.aspx?LocationID=580&Mode=1" />
精彩评论