search

Home  >  Q&A  >  body text

thinkphp5 URL how to hide public

I put the index module into public as written in the manual, and the application directory of the entry file was also changed.

Then the URL is servername/public/index.php

Online The tutorial says to directly set the website root directory to public.

Then I would like to ask, why can the index module be directly accessed when it is placed in the application?

正念的奇迹正念的奇迹2660 days ago2115

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-08-03 09:52:47

    The entrance is placed in the public for security reasons, so that the web cannot directly access the controller or template file without going through the entrance. This is safer and will not be attacked by hackers. Only access to open access points in the public is allowed. Not only TP5, the laravel framework is also in the public.

    reply
    0
  • Cancelreply