0

I've built a WebDeploy package of my ASP.NET MVC 4 website in Visual Studio 2012.

When I run the deployer on my server, it successfully deploys the website to a subdir on my server called /myapp

However, when I navigate to localhost/myapp in a browser, I get a 404. It appears IIS is looking for a physical path (one-to-one). How can I config IIS, or setup a rewrite rule, so that /myapp functions within itself?

For example, links and redirects that the website has are pointing to localhost/static/style.css, when they should be pointing to localhost/myapp/static/style.css

2
  • Which version of IIS are you using? Commented Oct 29, 2012 at 23:40
  • IIS 7. I think adding the ~ mark may work. Going to try right now. Strange this doesn't work right out of the box though. Commented Oct 29, 2012 at 23:45

2 Answers 2

2

You can use a tilde in your paths to tell ASP.NET to follow the path from the application root:

~/static/style.css
Sign up to request clarification or add additional context in comments.

Comments

0

Did you create an Application in IIS called myapp? It should have the path pointing to where you deployed the files for the website - in your case: /myapp

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.