為什么我的thinkPHP5訪問控制器 必須要localhost/項目名稱/public/index.php/admin/index/index這種才能訪問,怎么去掉public,并且按照收藏隱藏入口文件并不成功
1 回答
已采納

黃小凡
TA貢獻69條經驗 獲得超36個贊
以管理員身份編輯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,就能訪問到
- 1 回答
- 0 關注
- 3656 瀏覽
添加回答
舉報
0/150
提交
取消