很多框架都是把index.php放到public下面,但是看到yaf框架有两个版本(github和文档),那最好是放到哪里呢?
我试着把它放到public下面,http://localhost/yaf_test/是无法访问的,但是http://localhost/yaf_test/public是能重定向到默认controller下面的,那要怎么配置才能省略public呢(index.php放在public下面)?
很多框架都是把index.php放到public下面,但是看到yaf框架有两个版本(github和文档),那最好是放到哪里呢?
我试着把它放到public下面,http://localhost/yaf_test/是无法访问的,但是http://localhost/yaf_test/public是能重定向到默认controller下面的,那要怎么配置才能省略public呢(index.php放在public下面)?
nginx配置root指向public
server{
...
root /xxx/xxxx/public;
...
}
这样考虑目录安全性,比如配置目录 conf 就不用再去单独限制访问
我看了很多其他框架的目录结构,yii,zend framework,laravel是把.htaccess和index.php放到public下面的,phalcon是把.htaccess放到根目录,index.php放到public下面的
1 回答4k 阅读✓ 已解决
3 回答1.8k 阅读✓ 已解决
2 回答2.2k 阅读✓ 已解决
1 回答1.4k 阅读✓ 已解决
2 回答2.2k 阅读
1 回答1k 阅读
1 回答557 阅读✓ 已解决
apache或nginx配置虚拟路径指向项目的public文件夹
apache的httpd.conf中开启路径重写,去掉前面#号
httpd-vhosts.conf中配置一个虚拟路径
hosts中配置
重启apache,访问xxx.xxx.com
鸟哥的博客文档典型目录结构也是将index.php放在public中
http://www.laruence.com/manual/tutorial....