0

My site currently handles a URL encoded URL as one of the URI segments:

https://report-uri.io/home/pkp_analyse/https%3A%2F%2Fscotthelme.co.uk


I'm trying to replicate this functionality in an Azure Web App that's running IIS/8. I already have one rewrite rule for my MVC:

<rule name="CodeIgniter rewrite" stopProcessing="false">
    <match url="^(.*)$" />
    <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" />
</rule>


When I try to access the URL above I get a 500 error that states the following config file is not available:

D:\home\site\wwwroot\home\pkp_analyse\https:\web.config


What would be the correct way to handle the rewrite for this?

Scott Helme
  • 4,786
  • 2
  • 23
  • 35
  • That is strange! It would appear that the URL is flagging as a file or directory (not sure whether IIS calls the given URL, finds something and interprets it weirdly as a file). I can only suggest either simplifying the argument you are passing until you can work out which bit is causing the translation error or otherwise modify the site to use a querystring style to pass in the URL e.g. ?site=https%3A%2F%2Fscotthelme.co.uk which might stop it incorrectly flagging as file/directory. – Lukos Dec 21 '15 at 12:19
  • It seems to be the : that is causing problems so I tried using requestPathInvalidCharacters to allow it with the same problem. – Scott Helme Dec 22 '15 at 22:58
  • There is another property called relaxedUrlToFileSystemMapping="true" as mentioned here: http://stackoverflow.com/questions/2831142/asp-net-4-url-limitations-why-url-cannot-contain-any-3f-characters – Lukos Dec 24 '15 at 09:57

0 Answers0