Rewriting URLs - Problem with relative URLs on Theme/MasterPage
I have been trying to Rewrite specific URLs on my company website.
For links like this with query strings:
I want it to appear as :
I did this using URL Rewrite 2.0 for IIS 7
The problem I ran into is that for the page with rewritten URL I am having problems with links on my Menu tab and also on links to images and other resources.
For example: The image resources that it was trying to access from [~/App_Themes/<something>.jpg] are now changed to a location as [~/Corporate/App_Themes/<something>.jpg]
The attached screen shots show a Regular Page and a Page with rewritten URL for comparison.
If you have a look at the messed up URLs in the screen shot :
The homepage url has got two extra directories in between
whereas other URLs for images and resources have got only one extra directory name.
Any help with this problem is much appreciated.
Visual Statement Inc.
Some more insight into the problem.
I have resolved the problem for now by rewriting the URL in such a way that the page at new URL is at the same directory level. Something like this: