Tilde (~) virtual root url results in 404

D

davidkclark

Morning,

I have an ASP.NET website that has been running fine for some months.
It is a very simple single page form that submits back to itself. The
action for the form happens to use the virtual root token: action="~/
direct.aspx"

Yesterday the server was rebooted after a power failure, and this
morning submitting the form results in a 404 "The resource cannot be
found". The exception is:
[HttpException]: The file '/~/direct.aspx' does not exist.
at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath
virtualPath)
[...]

The url in the location bar is like:
http://example.com/~/direct.aspx
Which suggests to me that the ~ is not being translated as it should.

I have fixed it by making the url absolute, but we would like to know
what caused this problem. Has there been some update to IIS? Or what
configuration changes on the machine could cause ~ to stop working?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top