Relative Link Issues Using Friendly URL

I am using urlrewiter.net to implement friendly urls. This is a great and easy to use package.

However, when using subfolders, I had problems with relative links to images and to other internal pages.

I tried using ~ (server side) and it did not help. Is there any other solution?

+4
source share
3 answers

Due to these problems, I started to always give relative (to root) URLs, so let you have a subdirectory of images:

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

You always link to it through "/images/blah.jpg" .. and no matter what the base page / context, this image will be available.

+4
source

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

0
source

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

0
source