win server 2008 R2 system environment IIS application deployment vue single page

 

Recently used in the project vue framework for the development project, but after the completion of the packaged file, deployed on IIS server, but when there is a problem.

I could not find the route cause of the problem, because IIS on each route are specific points to physical path. The files of vue + webpack package generated is a single-page application. 404 can not be found so the situation will appear.

In the online search over more data, have said that the installation url rewrite and application request routing, and then solve. The vue official website also describes how to deploy the server under IISweb:

Establish a web.config file in the root directory of your website, reads as follows:

application request routing agent arranged to allow

 

 

But then, not how useful.

Later tests IIS server and found that each route is the path to the specific physical, so I should be set for each route point to the index.html page. It found that virtual directory on IIS is to solve this problem.

Therefore, the final solution is to establish a virtual directory corresponding to the route, and then point to the index.html page (pointing to the site directory file).

 

Guess you like

Origin www.cnblogs.com/auto123-num/p/11078690.html