File path problem after ThinkPHP is transplanted to local

WBOY
Release: 2016-07-06 13:51:13
Original
902 people have browsed it

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

File path problem after ThinkPHP is transplanted to local

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?

Reply content:

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

File path problem after ThinkPHP is transplanted to local

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>
Copy after login

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/..'

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template