1.新建.htaccess

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

注意最后一行demo替换为自己项目的子路径

2.将.htaccess文件放入项目所在的目录中

3.无需重启apache

作者 铁血 汉子 2019年6月7日
2024/03/29/02:48:11pm 2019/6/7/16:59:07
0 5273