0

I have an existing Angular website in that I want to deploy ASP.NET MVC application inside the virtual directory. the problem is when I try to route to ASP.NET MVC application inside a virtual directory it shows "403 - Forbidden: Access is denied." error on IIS.

I tried adding a new url rewrite rule in web.config of an angular application as given in

https://www.stefanoscerra.it/iis-rewrite-rules-configuration-angular-web-config/

but it tries to find the angular route and if not match any angular route it redirects to the angular default route

1 Answer 1

0

In I was having same scenario like this I solved by adding rewrite rule URL rewrite configuration in web.config .You will need to add rewrite rule like below.

<rule name="mvcinsideangularrule" stopProcessing="true">
      <match url="mvcvirtualdir/(.*)/(.*)/(.*)" />
      <action type="Rewrite" url="http://yourdomain.com/mvcvirtualdir/{R:1}/{R:2}/{R:3}"/>
</rule>

It will work in your scenario.

your rewrite configuration in IIS will look like..

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.