Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page doesn't apply css styles when rewriting an url address 1

Status
Not open for further replies.

Entrep

Technical User
Sep 10, 2008
9
0
0
ES
Hi,
I’m rewriting url addresses like this to this , but when the page is displayed css styles aren’t applied, and errors appears in browser’s bottom bar. So, a very ugly page.. (I attach below the code I used for rewrite the url)
Is this a problem of Internet Information Server configuration? Or something related to rewriting usage? I’m using urlrewritingnet component (
Thank you

Code:
    <urlrewritingnet
      rewriteOnlyVirtualUrls="true"   
      contextItemsPrefix="QueryString" 
      defaultPage = "default.aspx"
      defaultProvider="RegEx"
      xmlns="[URL unfurl="true"]http://www.urlrewriting.net/schemas/config/2006/07"[/URL] >
       <rewrites>	

           <add name="user_web" 	 
                    virtualUrl="^~/(.+)/web" 
                    rewriteUrlParameter="ExcludeFromClientQueryString" 
                    destinationUrl="~/user_page.aspx" 
                    ignoreCase="true" />    

      </rewrites>     
    </urlrewritingnet>
 
If you are rewriting the URL then you will have to make sure that the path to your css file takes into account the new URL. Have a look at the rendered html and see if the path to the css file is still correct (which by the sounds of it certainly won't be).

Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
Yes! You are great
Thank you very much

Instead of paths like this “<link href="CSSfolder/table1.css" rel="stylesheet" type="text/css">” I have put “<link href="../CSSfolder/table1.css" rel="stylesheet" type="text/css">”, so that indicate a relative path (the location of the current webpage). In that way works fine, at least testing website locally.

And the same thing to images and scripts:
<img src="../Design/head14/big_logo.gif">
<script type="text/javascript" src="../Validations/published_posts/search_posts.js"></script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top