zoukankan      html  css  js  c++  java
  • vue 项目部署后 刷新一下 页面找不到 解决

    1.修改配置router的参数  (效果不好)

    2. (不能解决 出现403)

    后端配置例子
    
    Apache
    
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index.html$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.html [L]
    </IfModule>
    

      


    3.发现这个配置依然有问题 继续排坑 


    在httpd.conf找了一下,<Directory>权限配置的问题,XAMPP默认的设置是这样的:

    #<Directory />
       AllowOverride none
        Require all denied
    </Directory>

    修改成下面

    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
    </Directory>

    4.还是不行 继续排坑 最终解决!

    <Directory "D:/Documents/abc/php/basic/web">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
    

      

    5.补充 根本原因 

     01.httpd-vhosts.conf的配置

      

    NameVirtualHost *:9090
    <VirtualHost *:9090>
    ServerAdmin webmaster@dummy-host.localhost
    DocumentRoot "D:workwebvue-cli-workdist"
    ServerName www.tongtong.com
    ServerAlias *.www.tongtong.com
    ErrorLog "logs/localhost-error_log"
    </VirtualHost>
     
    02.  .htaccess文件的 增加 注意不要有后缀

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.html$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.html [L]
    </IfModule>

    03.其他参考 http://www.cnblogs.com/tongbiao/p/9403381.html

    https://www.tongbiao.xyz/
  • 相关阅读:
    UI Automator Viewer工具的使用
    SQL数据库面试50题(转载)
    Python +selenium+pycharm(Windows)
    python安装及环境变量配置(Windows)
    JDK的安装与环境变量配置
    shell参数
    文件添加行号
    CentOS 7修改UTC为CST
    shell控制超时
    fio笔记
  • 原文地址:https://www.cnblogs.com/tongbiao/p/9384034.html
Copyright © 2011-2022 走看看