browser-sync


How to replace .html with forward slash in BrowserSync?


I am developing website using BrowserSync. However, in the production version, I will be replacing .html with forward slash via .htaccess . Is it possible to achive the same result using BrowserSync?
You can start your browsersync with next server config:
server: {
baseDir: "./build",
serveStaticOptions: {
extensions: ['html']
},
middleware: function(req, res, next) {
var url = req.url;
if (url.length > 1 && url[url.length-1] === "/") {
req.url = url.slice(0, url.length - 1);
}
return next();
}
}
Not perfect solution, but if you go to http://foo/bar/ instead http://foo/bar.html it will not cause get error.

Related Links

Quit Browser-sync from terminal
lite-serverbs-config.js: middleware and array of folders
Make BrowserSync use the real https URL
Can we use browser sync on external url
How to replace .html with forward slash in BrowserSync?
Error during instillation of browser sync
When using browser-sync,why is the browser saying cannot get, while everything seems fine
How to sync the actions performed on webpage using Browsersync?
lite-server, BrowserSync: setting other URL path than /
Gulp and Browsersync injecting CSS but causing a full reload
Browser-sync - serve “node_modules” out of “src” directory
[browser-sync]browser-sync proxy can't connect to Rails Application
Browserstack not serving index.html by default
whatever i do i can't access the external URL for the site or UI
How do I kill browserSync before creating it?
Unable to install browser-sync on windows 7

Categories

HOME
uml
eclipse
adal
wakanda
android-studio-2.2
angular2-material
gradient
database-normalization
spring-data-mongodb
entity-framework-core
carousel
vxml
pyqt4
jetty
x264
nuget-package
accessibility
32bit-64bit
dkim
heap
activecollab
mautic
qsqlquery
xmonad
drive
cgbitmapcontext
data.stackexchange.com
onload
definitelytyped
beautifier
oculus
entity-relationship-model
android-things
exchangewebservices
alm
python-2.6
mustache
cognos-bi
testbed
code-snippets
video-capture
apic
alphabetical
google-knowledge-graph
playframework-2.1
zoomify
ideascript
sim-card
railstutorial.org
mongoose-schema
urlsession
ogc
apriori
wmp
microsoft-metro
plr
tcc
getchar
reportservice2010
video-conferencing
wpas
modelsim
android-testing
reshape
mouseleave
template-toolkit
pocketsphinx-android
cronexpression
custom-lists
centrifuge
uicolor
appscale
beanstalk
blitline
zen-cart
opserver
eoferror
uncompress
sql-server-data-tools
linked-tables
variadic-templates
punycode
appserver
vbe
dsym
model-driven-development
android-sdk-2.3
panda3d
jdb
cross-database
filemerge
automationelement
qglwidget
uideviceorientation
instantiationexception
jqueryform
blender-2.49
lxr
visualj#
application-planning
unmanagedresources
pbcopy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App