Timeline for IIS7 rewrite rule triggers 404 rather than redirecting to new pagw
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 28, 2019 at 14:49 | comment | added | SKidd |
I tested with the absolute URL and no redirect, but using the (.*)default.htm$ did the trick. No idea why but it did the job.
|
|
Feb 27, 2019 at 18:36 | history | edited | MrWhite | CC BY-SA 4.0 |
Removed "update" notes.
|
Feb 27, 2019 at 11:25 | comment | added | MrWhite |
Glad that resolved your problem. Are you saying that using an absolute URL (ie. url="http://www.example.com/{R:1}default.asp" ) did not work at all or resulted in a malformed redirect or something? Minor fix to the above regex: the second dot in (.*)default.htm$ should strictly be backslash-escaped, so should read (.*)default\.htm$ (I've updated my answer).
|
|
Feb 27, 2019 at 11:18 | history | edited | MrWhite | CC BY-SA 4.0 |
Added backslash escape for the dot
|
Feb 27, 2019 at 11:10 | comment | added | SKidd |
That worked with one change as follows: <rule name="replacedefaulthtm" stopProcessing="true"><match url="(.*)default.htm$" ignoreCase="true" /> <action type="Redirect" url="{R:1}default.asp" redirectType="Permanent" />redirectType="Permanent" /> </rule>`
|
|
Feb 27, 2019 at 11:07 | vote | accept | SKidd | ||
Feb 27, 2019 at 10:15 | history | edited | MrWhite | CC BY-SA 4.0 |
Update to include general solution
|
Feb 27, 2019 at 9:55 | history | edited | MrWhite | CC BY-SA 4.0 |
Mentioned regex
|
Feb 26, 2019 at 18:50 | history | answered | MrWhite | CC BY-SA 4.0 |