由于子文件夹,图像和脚本链接不好

I am new to ProcessWire and I have a simple question. I transferred from being hosted on a server to running form a local site and some images, scripts, and links to pages are not showing up correctly.

The Homepage can be found at "http://localhost/restaurant/release/" and, for example, a relative link to some script is currently something like <script src="/site/templates/scripts/f.js">.

The problem is that, when the browser tries to access this link, it actually gets "http://localhost/site/templates/scripts/f.js" instead of "http://localhost/restaurant/release/site/templates/scripts/f.js".

How does ProcessWire handle these kinds of links? And how do I fix them?

You need to set the base tag in your HTML head:

<base href="http://localhost/restaurant/release">

Use your links as per normal:

<script src="/site/templates/scripts/f.js">

Alternatively, simply omit the leading slash from the script src.