How to Run Magento 2 using pub/index.php file(怎么将magento2默认首页改到index.php)

Magento 2 comes with two index.php files where one file is inside root folder and another one is inside /pub folder. Magento 2 offers to run your application using any one of this file. If you choose to run your application using /pub/index.php then it is a good decision for security point of view as it restrict unauthorized direct access of application files.

Here i will show you how to configure Magento 2 in localhost using pub/index.php file by creating virtualhost. You can do the same by following below steps after installing Magento 2.

  1. Open httpd-vhosts.conf file of apache server. You wll find this file at “D:\xampp\apache\conf\extra” location.
  2. Create virtual host by adding below code in httpd-vhosts.conf file.
    vhosts
  3. Save httpd-vhosts.conf file and restart apache server.
  4. Open C:\Windows\System32\drivers\etc\hosts file and add your server Name entry as like below.
    hosts
  5. Open your Magento 2 database table “core_config_data“. Update value for path “web/unsecure/base_url” and “web/secure/base_url” to “http://local.magento2.com/“.
    core-config-data
  6. Open web browser and hit URL: “http://local.magento2.com” for frontend and “http://local.magento2.com/admin” for backend.
    frontendbackend

Now your application is running using pub/index.php file.

转载自:https://darshanbhavsar.wordpress.com/2015/02/04/how-to-run-magento-2-using-pubindex-php-file/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值