thinkphp5的访问路径问题

为什么我的thinkPHP5访问控制器 必须要localhost/项目名称/public/index.php/admin/index/index这种才能访问,怎么去掉public,并且按照收藏隐藏入口文件并不成功

大写的王
浏览 3546回答 1
1回答

黄小凡

以管理员身份编辑C:\Windows\System32\drivers\etc\hosts 文件,添加一行127.0.0.1       www.想设置的域名.com 然后在Apache下的httpd-vhosts 添加该域名访问目录<VirtualHost *:80> ServerName www.想设置的域名.com DocumentRoot D:/wamp64/www/tptest/public  //你对应的thinkphp5的public目录 <Directory  "D:/wamp64/www/tptest">   //你对应的thinkphp5的public目录 Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost>重启服务器,这个时候打开  www.想设置的域名.com,就能访问到
打开App,查看更多内容
随时随地看视频慕课网APP