1. I copied a project on the server and put it locally localhost/project
. Originally, entering this path should jump to localhost/project/Auth/login
It jumps like that on the server, but when I transplant it to the local, it jumps Here we are localhost/Auth/login
What’s the problem? My .htaccess
file also has configuration hidden index.php
Also, after I entered localhost/project/Auth/login
, none of his files under PUBLIC were loaded. The path was wrong, resulting in images, CSS, and JS being unable to be read. The file directory under PUBLIC is basically introduced in the form of <css href="/Public/AAA/a.css" />
. Is it a configuration problem?
1. I copied a project on the server and put it locally localhost/project
. Originally, entering this path should jump to localhost/project/Auth/login
It jumps like that on the server, but when I transplant it to the local, it jumps Here we are localhost/Auth/login
What’s the problem? My .htaccess
file also has configuration hidden index.php
Also, after I entered localhost/project/Auth/login
, none of his files under PUBLIC were loaded. The path was wrong, resulting in images, CSS, and JS being unable to be read. The file directory under PUBLIC is basically introduced in the form of <css href="/Public/AAA/a.css" />
. Is it a configuration problem?
Replace /Public
with __PUBLIC__
and try
Create a virtual host or place the program in the root directory of the server /
Positioning (not accurate) is the domain name, which is what you have here localhost
For TP, introduce static files (css , js and the like) generally use __PUBLIC__
to generate jump/access addresses. If you use the U
function, such as:
<code>U('/Auth/login');//路由 U('Auth/login');</code>
If the root directory structure is different after using absolute path migration, there will definitely be problems. Do not use '/public/..' for the resource path, use __ROOT__.'/public/..'