IIS 7 and Above
URL Rewrite Module
URL rewrite not keeping path
Last post Jun 08, 2018 05:43 AM by deepakpanchal10
Jun 05, 2018 04:23 PM|rhamaker|LINK
Guys this is probably a dumb simple problem but i cant figure it out. I have an IIS server, server1, running IIS and a website on it that runs perfect. I have added a virtual directory to it and used URL rewrite to make
http://server1/gallery point to
http://gallery. The rewrite works fine until i try to use links on the rewritten URL. So for instance if i click the upload link on the rewritten web page, the link SHOULD be
http://server1/gallery/upload, but it is just taking me to
http://server1/upload and it is failing to load the page. If i manually change the link to http://server1/gallery/upload it works fine. Is there a way to append the /gallery/
to all the links as it lists them on the page?
Jun 06, 2018 02:19 AM|deepakpanchal10|LINK
Does that rule also run when you click on link on rewritten page?
You can try to use failed request tracing.
IIS 7.0 and above Failed Request Tracing (FRT) is a powerful tool for troubleshooting request-processing failures. FRT can be used with the URL rewrite module to trace how rewrite rules were applied to the request URL. This walkthrough will
guide you through how to use FRT to troubleshoot and debug URL rewriting rules. For more information about Failed Request Tracing, see
For a detailed steps, you can refer link below.
Using Failed Request Tracing to Trace Rewrite Rules
Jun 07, 2018 07:27 PM|rhamaker|LINK
Thanks for the reply. I have FRT setup on this machine but it really isnt capturing anything useful. It seems like i need an outbound rule that will manipulate the data that is being sent back to the client to change the URL to the public URL vs the private
URL. There are no outbound rules configured but it seems as though i need one that changes server1/upload to server1/gallery/upload.
When i try to add an outbound rule as such the whole site dies
Jun 08, 2018 05:43 AM|deepakpanchal10|LINK
Did you try to write another inbound rule to match pattern like "server1/upload" and redirect to "server1/gallery/upload".
If you did not try that then you can have a try.
It may help you to solve your issue.