I have placed my program within a subfolder on the server: localhost/program and when the program runs it runs correctly however all action links and images point to localhost/… rather than localhost/program/…?
I have tried to change my routing by adding “program/” to the beginning of “{controller}/..” however this seems to have little effect? Any suggestions?
You should use
Url.Contentto solve a url for any file or resource on your site. The parameter passed is the relative path prefixed with a tidle (~):The result would be (based on your setup):
A relative virtual path is relative to the application root directory, if it is just a tilde (~) or starts with the tilde and a double backslash (~\\) or the tilde and a slash mark (~/).