It was interesting - I had to redo :) In my comment above, what I was trying to say was "no need to ignore."
I was "right" and "wrong."
- right: no need to ignore
- Wrong: not because of what I said (re: physical file), but rather, not causing the redirect in the first place.
This will crash (redirect, POST data loss):
<asp:Button ID="btn1" runat="server" Text="Go" PostBackUrl="~/Target.aspx" />
This will be fine (you will receive POST data, there will be no redirection):
<asp:Button ID="btn1" runat="server" Text="Go" PostBackUrl="~/Target" />
Difference? I do not ask FriendlyUrls to “redirect” anything in the second option. In the first version, I request the file "aspx", so FriendlUrls faithfully performs its task in order to be and "process" it (and perform constant redirection to the "friendly URL", which is GET, and everything goes POSTed).
- Check the request in the 1st option ( target.aspx ):

- Check the request in the second option (without limitation, purpose ):

It was a clue:
var settings = new FriendlyUrlSettings(); settings.AutoRedirectMode = RedirectMode.Permanent;
And he does what he says, "makes a permanent redirect" (to the "friendly URL") ... when "necessary" (if the "aspx" file is requested). You can tinker with this with any page on the WebForms website.
- if you request
foo.aspx you will see a redirect (before foo ) - if you request
foo , redirect
You can also comment
settings.AutoRedirectMode = RedirectMode.Permanent;
and everything will work, but the FriendlyUrls target seems to hit ...
Thinking about it, it makes sense. There is no need to redirect for each request (ugh for performance), but only if / when it is necessary ...
Hth ....
source share