Reputation: 1929
I have a simple aspnet core web app that I run locally at my root http://localhost/
and I'm publishing it to my IIS server which is http://192.168.1.100/MyApp
when I click on any links, I'm always brought to the root of the domain and not my sub-app.
I've tried relative urls like href='/home/index'
, href='home/index'
but they work in one place and not another.
Is there a way to accomplish this with either vanilla html or some razor?
Upvotes: 0
Views: 37
Reputation: 21
Toss a tilde (~
) in front of any links you're creating with Razor, which will make the link relative to the app's root.
Upvotes: 1