Answer the question
In order to leave comments, you need to log in
Why doesn't base href work with links like "/link" on localhost?
1. The production version of the project has base href=" www.mysite.com "
2. The local version: base href="http\\localhost/mysite/"
3. The pages have links like "/link1"
As a result:
1. On the production server (Ubuntu, Apache) the links lead to www.mysite.com/link1, as expected
2. On the local server (OS X, Apache) the links lead to localhost/link1
What could be the problem?
Answer the question
In order to leave comments, you need to log in
A link starting with /
is a link from the root of the site, it is absolute within the site.
base only affects relative references, i.e. in order to take the path from base, the link must not be /link1
alink1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question