Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blazor Relative url

I have navlink defined as follows

<NavLink href="/intro"></NavLink>

In dev it works fine as the root of the site is at the same level as the blazor app. In prod I have to put the blazor site inside a folder in the default iis website. So my url becomes something like this

http://something/apps/cor/

So the <NavLink href="/intro"></NavLink> ends up trying to go to http://something/intro instead http://something/apps/cor/intro

I tried both /intro and intro and the both result in the wrong behavior. I am not getting how to make those links relative to blazor root not iis root.

like image 405
americanslon Avatar asked Jun 11 '26 20:06

americanslon


2 Answers

Dot before the path. ./intro is how you do it

like image 71
americanslon Avatar answered Jun 13 '26 19:06

americanslon


on index.html you should have <base href="/apps/cor/" />

like image 42
Bart Calixto Avatar answered Jun 13 '26 18:06

Bart Calixto