G
G
goodw842019-06-29 12:46:51
Apache HTTP Server
goodw84, 2019-06-29 12:46:51

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

1 answer(s)
V
Vladimir Dubrovin, 2019-07-01
@z3apa3a

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 /link1alink1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question