2
I developed a project in ASP.NET MVC and now I’m going up to the server.
Turns out on my local machine, it takes the localhost address, something like this:
But when publishing on the server, it’s there:
www.dominio.com/meuprojeto
So here comes the trouble.
I had to rename all references to my javascript, css etc.
where I was standing :
<script type="text/javascript" src="/Js/exemplo.js"></script>
I had to rename to:
<script type="text/javascript" src="/meuprojeto/Js/exemplo.js"></script>
Is there any other solution without me having to rename everything ?
because the project on my local machine now gets lost, and on the server gets right.
if you can take the
/
initial or exchange for./
so it uses the relative path of the folder, ie with itsindex
is inwww.dominio.com/meuprojeto
when usingsrc='./Js/exemplo.js'
will equalsrc='www.dominio.com/meuprojeto/Js/exemplo.js'
and locally if yourindex
this inlocalhost:8080
he had stayedsrc='localhost:8080/Js/exemplo.js'
– Icaro Martins