asp.net mvc - MVC bundles and IIS virtual directories (URL rewrite) -
i'm hosting multiple applications on iis server virtual directories , i'm using url rewrite facilitate them. images , other assets manually written "~/path/to/my/content"
has correct output "/path/to/my/content"
, bundle paths "~/client/js"
gives output "/myapplication/client/js"
should "/client/js"
.
how can fix that?
how initiate script bundle:
var scriptbundle = new scriptbundle("~/client/js");
rewrite configuration:
<rule name="official website" stopprocessing="true"> <match url="(.*)" /> <conditions> <add input="{http_host}" matchtype="pattern" pattern="^(www\.)?domain\.com$" ignorecase="true" negate="false" /> </conditions> <action type="rewrite" url="officialsite/{r:1}" /> </rule>
was looking these topics, couldn't make work me:
- how system.web.optimization bundles work custom folders in iis virtual directory?
- cssrewriteurltransform or without virtual directory
- why resolvebundleurl not work custom folders? (mvc beta 4)
- is possible unit test bundleconfig in mvc4?
update: i'm using winhost hosting provider, , not support setting host headers ip, due shared ip. provide domain pointers root folders, why i'm using url rewrite.
you said :
i'm hosting multiple applications on iis server virtual directories , i'm using url rewrite facilitate them
so, problem refers root configuration (virtual directory) usable bundling , etc.., it's not bundling configuration or rewrite rule. think need setup myapplication directory virtual , set separate website. make sure have followed instructions available in create web site says:
you add web site in iis, site entry created in applicationhost.config file. entry specifies:
- network binding site
- maps site location in file system
- optionally specifies user credentials content access
to ensure user requests reach correct web site, must configure unique identity each site on server.web sites hosted on same server can distinguished using following unique identifiers.
- host header name (recommended)
- ip address
- tcp port number
configure host header web site (iis 7) points first one.
update: think there may name conflict on server , project. more brightly try change client in ~/client/js
, folder new one. unless there multiple path choices (with path depth) server fetch can solve adding depth adding \
in project , js bundle mapping.
update2: suggest follow full article available in how publish or host subdomain on winhost.com? solve such amazing issue :)
Comments
Post a Comment