问题描述
我有一个带有browserSync和以下结构的Gulp站点:
.
├── README.md
├── gulpfile.js
...
├── app/
│ ├── index.html
│ ├── example.html
│ ├── tools.html
│ └── tools/
└── dist/
当我尝试通过http://localhost:3000/tools
访问工具页面时,返回301重定向,将我重定向到http://localhost:3000/tools/
。
http://localhost:3000/example
页工作正常,只有存在相同名称的文件夹时,才会发生此问题。
这是我的Gulpfile的内容:
// Starts browserSync
gulp.task('serve',function(done){
browserSync({
server: {
baseDir: './dist',index: "index.html",serveStaticoptions: {
extensions: ['html']
}
}
});
done();
});
请注意,http://localhost:3000/tools.html
可以使用,但是我不想使用扩展名。如何在不重定向的情况下访问/tools
页?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)