dongpu9481 2015-03-21 21:00
浏览 64

Yii2 - 基本应用程序模板的URL

I have just installed the Yii2 Basic Application Template using Composer.

This is now accessible on my localhost machine at the following URL:

http://localhost/basic/web

In Yii 1.1, it was possible to access a web application by simply going to :

http://localhost/basic

Having done some reading, it appears the only way to achieve the above is to create a new Apache vhosts entry. Whilst this is fine for one or two sites, if like myself you are working on new sites all the time, it is a bid tedious to have to set up vhosts for each and every site.

I have tried creating a .htaccess file to redirect all requests to web/index.php but this does not work. Is this at all possible to do in Yii2?

  • 写回答

1条回答 默认 最新

  • dpbl91234 2016-06-22 17:06
    关注

    Move all the content in the /basic folder to eg. /basic-yii instead. Then take the /basic/web folder (now /basic-yii/web) and put all it's content into the /basic folder. Then adjust the paths for the require() calls in /basic/index.php to correctly point to autoload.php, Yii.php and web.php.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行