Subdomain does not load styles and scripts

1

Good morning,

1- I created a new solution in Visual Studio 2012;

2- I created ASP.NET MVC 4 Web Application. I opted for a "BASIC" project, Framework 4.5 and the Razor engine;

3- I created the Home controller;

4 - I created the view Index.cshtml;

The content of the Index.cshtml page has only one text and one debug

I did not do anything, just the main content of a "BASIC" project.

Published, see result:

What do I have to do for scripts and styles to load into the subdomain?

Thanks for the help.

    
asked by anonymous 13.02.2015 / 11:54

1 answer

1

This is the subdomain source code on the date of this response. Notice that you have loaded scripts and css correctly within <head> in minified form:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link href="/imobiliaria589s42d78/Content/css?v=ji3nO1pdg6VLv3CVUWntxgZNf1zRciWDbm4YfW-y0RI1" rel="stylesheet"/>

    <script src="/imobiliaria589s42d78/bundles/modernizr?v=qVODBytEBVVePTNtSFXgRX0NCEjh9U_Oj8ePaSiRcGg1"></script>

</head>
<body>


<h2>Host</h2>
<h2>imobiliaria589s42d78.meudominio.com.br</h2>


    <script src="/imobiliaria589s42d78/bundles/jquery?v=JzhfglzUfmVF2qo-weTo-kvXJ9AJvIRBLmu11PgpbVY1"></script>


</body>
</html>
<html>
<div id="haackroutedebugger" style="background-color: #fff; padding-bottom: 10px;">
    <style>
        #haackroutedebugger, #haackroutedebugger td, #haackroutedebugger th {background-color: #fff; font-family: verdana, helvetica, san-serif; font-size: small;}
        #haackroutedebugger tr.header td, #haackroutedebugger tr.header th {background-color: #ffc;}
    </style>
    <hr style="width: 100%; border: solid 1px #000; margin:0; padding:0;" />
    <h1 style="margin: 0; padding: 4px; border-bottom: solid 1px #bbb; padding-left: 10px; font-size: 1.2em; background-color: #ffc;">Route Debugger</h1>
    <div id="main" style="margin-top:0; padding: 0 10px;">
        <p style="font-size: .9em; padding-top:0">
            Type in a url in the address bar to see which defined routes match it. 
            A {*catchall} route is added to the list of routes automatically in 
            case none of your routes match.
        </p>
        <p style="font-size: .9em;">
            To generate URLs using routing, supply route values via the query string. example: <code>http://localhost:14230/?id=123</code>
        </p>
        <p><label style="font-weight: bold; font-size: 1.1em;">Matched Route</label>: {controller}/{action}/{id}</p>

        <div style="float: left;">
            <table border="1" cellpadding="3" cellspacing="0" width="300">
                <caption style="font-weight: bold;">Route Data</caption>
                <tr class="header"><th>Key</th><th>Value</th></tr>
                    <tr><td>controller</td><td>Home&nbsp;</td></tr> <tr><td>action</td><td>Index&nbsp;</td></tr>
            </table>
        </div>
        <div style="float: left; margin-left: 10px;">
            <table border="1" cellpadding="3" cellspacing="0" width="300">
                <caption style="font-weight: bold;">Data Tokens</caption>
                <tr class="header"><th>Key</th><th>Value</th></tr>

            </table>
        </div>
        <hr style="clear: both;" />
        <table border="1" cellpadding="3" cellspacing="0">
            <caption style="font-weight: bold;">All Routes</caption>
            <tr class="header">
                <th>Matches Current Request</th>
                <th>Url</th>
                <th>Defaults</th>
                <th>Constraints</th>
                <th>DataTokens</th>
            </tr>
            <tr><td><span style="color: #c00">False</span></td><td>api/{controller}/{id}</td><td>id = </td><td>(empty)</td><td>(null)</td></tr><tr><td><span style="color: #c00">False</span></td><td>{resource}.axd/{*pathInfo}</td><td>(null)</td><td>(empty)</td><td>(null)</td></tr><tr><td><span style="color: #0c0">True</span></td><td>{controller}/{action}/{id}</td><td>controller = Home, action = Index, id = UrlParameter.Optional</td><td>(empty)</td><td>(empty)</td></tr><tr><td><span style="color: #0c0">True</span></td><td></td><td>controller = Home, action = Index, id = </td><td>(empty)</td><td>(empty)</td></tr><tr><td><span style="color: #0c0">True</span></td><td>{*catchall}</td><td>(null)</td><td>(null)</td><td>(null)</td></tr>
        </table>
        <hr />
        <h3>Current Request Info</h3>
        <p>
            AppRelativeCurrentExecutionFilePath is the portion of the request that Routing acts on.
        </p>
        <p><strong>AppRelativeCurrentExecutionFilePath</strong>: ~/</p>
    </div>
</div>

EDIT

The route is even considering the bundling directories, which is wrong. Bundles are special references to your project.

I do not know how to configure Locaweb, but in your case, what solves it is by referring to static scripts and css ( /Content/ directory) or by using CDN.

According to comments, something you can resolve is to specify the following in the web.config file:

<location path="." inheritInChildApplications="false">
    
13.02.2015 / 14:59