thinkphp file path problems after porting to local

Source: Internet
Author: User

1. I copy a project on the server down to local localhost/project , originally entered this path should jump tolocalhost/project/Auth/login
The server is jumping like that, but I migrated to the local to jump to thelocalhost/Auth/login
Where is the problem? My .htaccess files have also been configured to hideindex.php

And I entered localhost/project/Auth/login after his public files are all not loaded, the path error, resulting in images, CSS, JS are not read. The file directory under public is basically introduced in the form of a configuration problem

Reply content:

1. I copy a project on the server down to local localhost/project , originally entered this path should jump tolocalhost/project/Auth/login
The server is jumping like that, but I migrated to the local to jump to thelocalhost/Auth/login
Where is the problem? My .htaccess files have also been configured to hideindex.php

And I entered localhost/project/Auth/login after his public files are all not loaded, the path error, resulting in images, CSS, JS are not read. The file directory under public is basically introduced in the form of a configuration problem

/PublicReplace the __PUBLIC__ test with the

Create a virtual host or place the program in the server root directory
/Location (not accurate) is the domain name, you are here localhost
For TP, the introduction of static files (CSS,JS, etc.) is generally used__PUBLIC__
A function is used when generating a jump/access address U , such as:

U('/Auth/login');//路由U('Auth/login');

If the root directory structure is different after the absolute path is migrated, the resource path must not be '/public/. ', with __root__. ' /public/. '

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.