views:

226

answers:

3

I'm using urlrewiter.net in order to implement friendly url's. It's a great and easy to use package!

Nevertheless, while using subfolders I had problems with the relative links to images and to other inner pages.

I tried to use ~ (server side) and it didn't do the trick. Is there another solution?

A: 

You should probably segment your site so static elements (images, css, etc) are in separate location from your dynamically generated urls. I've used URlRewriter extensively in the past, and it worked great, but our site was setup so that our resources were segmented like that.

Jason
+4  A: 

Because of these issues, I've started to be always give relative (to the root) URLs, so let's say you have an images subdirectory:

http://www.contoso.com/images/blah.jpg

You'd always reference it via "/images/blah.jpg" .. and no matter what the base page/context is, that image will be accessible.

Nicholas H
i'd vote this up twice if i could. thanks for the tip.
adrianos
A: 

You can simply add base tag to your HTML headers. This will force browsers to use specified location to resolve relative links. Maybe this article will help you: SEO-Friendly URLs and Relative Links