1

When using angularjs, there is the # that needs to be removed. To accomplish that you need to set the following:

$locationProvider.html5Mode(true);

and also add the base tag so when the page refreshes it works normally. The point is if it's defined as <base href="http://example.com/"> then it only works from this url. i.e I can not access the website from www.example.com.

So is there a way to configure some sort of multiple base so that when one fails, it gets replaced with the other?

1

2 Answers 2

2

<base href="/"></base> - for ROOT webapps.

<base href="/webappName/"></base> - for non ROOT webapps.

Also, you only need to use the the <base> tag if you have relative <a> tags.

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

Comments

1

You can use:

<base href="/">

Or if you don't want to use base:

$locationProvider.html5Mode({ enabled: true, requireBase: false });

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.