Question

I was working on my project normally, doing deploy of the solution, but in a moment, after of last deploy, the URL of the solution was changed, the correct URL solution is "...sites/dev/SitePages/App/Pages/default.aspx" but after of the last deploy the URL change to*"...sites/dev/SitePages/App2/Pages/default.aspx"*, adding "2" in the solution name (App2).

I don't know what to do, I did not touch the URL in my code, I just added a new line of code, but I don't rename the solution name or something like that.

Was it helpful?

Solution

Try this, in the master page

<script>
        var arrayUrl = _spPageContextInfo.webServerRelativeUrl.split('/');
        var siteUrl = arrayUrl[arrayUrl.length - 1];
</script>

Use that, and replace all "App Name" for "siteUrl" variable

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top