1: nginx server solution, modify the .conf configuration fileThere are two solutions 1: location / { try_files $uri $uri/ @router; index index.html; } location @router { rewrite ^.*$ /index.html last; } 2: location / { error_page 404 /index.html; #try_file $uri $uri/ /index.html =404; } 2: Apache server solution(Assuming it is placed in the csdn directory) is divided into the following steps 1. Configure routing: Use history mode and configure base 2. Change assetsPublicPath in the config/index.js file to the file path you put on the server. The root directory is '/'. If it is placed in a folder, for example: /csdn/' 3. Modify Apache's httpd.conf file to support .htaccess, 4. Add the .htaccess file to the corresponding folder project. (Note that Windows does not support the format without a file name, i.e. .***, so you need to create a new text document first, write the content, then upload it to the corresponding directory via FTP, and then rename it. You will not be able to see it after renaming it here, so you need to set FTP to view hidden files) <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /csd/ RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /csd/index.html [L] </IfModule> 5. Restart the server SummarizeThis concludes this article about two solutions to the 404 problem of refreshing the vue package upload server. For more relevant vue package upload server 404 content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Explanation of the steps for Tomcat to support https access
>>: Solution to MySQL failure to start
What is bubbling? There are three stages in DOM e...
Preface This article mainly introduces the relati...
Table of contents Preface Scenario simulation Sum...
React Native is a cross-platform mobile applicati...
Table of contents Preface 1. Monadic Judgment 1.1...
If you are using the latest Ubuntu Server version...
<br />In text design, we usually focus on th...
Method 1: Use script method: Create a common head...
This article shares the specific code for JavaScr...
Use the following terminal command to install the...
Table of contents Early creation method Factory P...
Table of contents introduce Usage scenarios Sourc...
Table of contents 1. Comments on MySQL primary ke...
View the dependent libraries of so or executable ...
Tabs: Category + Description Tag bar: Category =&...