Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs Webpack 4开发服务器排除路径_Reactjs_Webpack_Webpack 4 - Fatal编程技术网

Reactjs Webpack 4开发服务器排除路径

Reactjs Webpack 4开发服务器排除路径,reactjs,webpack,webpack-4,Reactjs,Webpack,Webpack 4,所以我正在运行一个带有Webpack4Dev服务器的react应用程序。我在index.html所在的文件夹中有一个silent-renew.html文件。我需要能够转到localhost:8080/silen续订,它需要打开HTML文件。但现在,每当我去/sometimg时,它都会使用index.html启动spa。我不能使用代理,因为它用于/API。并且看起来代理服务器无法处理多个路径。请考虑使用htaccess file设置索引文件,如以下代码段所示: RewriteEngine On R

所以我正在运行一个带有Webpack4Dev服务器的react应用程序。我在index.html所在的文件夹中有一个silent-renew.html文件。我需要能够转到localhost:8080/silen续订,它需要打开HTML文件。但现在,每当我去/sometimg时,它都会使用index.html启动spa。我不能使用代理,因为它用于/API。并且看起来代理服务器无法处理多个路径。

请考虑使用htaccess file设置索引文件,如以下代码段所示:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$

RewriteRule ^$ http://example.com/silen-renew.html [L,R=301]