duanlu1279 2017-01-03 05:48
浏览 327
已采纳

PhP本地主机重定向到/var/www/html/index.php

I am using Ubuntu machine. I am running lampp server for php files.

I have all my PHP files in my_folder where I have all my codes in /opt/lampp/htdocs/my_folder including index file in /opt/lampp/htdocs/my_folder/index.php.

I wanted to check my codes by running http://localhost/index.php in Chrome browser, but for some reason it keeps directing me to /var/www/html/html.index file. Can someone please help me resolve this problem?

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • doudou20145 2017-01-03 05:51
    关注

    add this to you apache config.

    DocumentRoot /opt/lampp/htdocs/my_folder
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /opt/lampp/htdocs/my_folder>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 基于信创PC发布的QT应用如何跨用户启动后输入中文
  • ¥20 非root手机,如何精准控制手机流量消耗的大小,如20M
  • ¥15 远程安装一下vasp
  • ¥15 自己做的代码上传图片时,报错
  • ¥15 Lingo线性规划模型怎么搭建
  • ¥15 关于#python#的问题,请各位专家解答!区间型正向化
  • ¥15 unity从3D升级到urp管线,打包ab包后,材质全部变紫色
  • ¥50 comsol温度场仿真无法模拟微米级激光光斑
  • ¥15 上传图片时提交的存储类型
  • ¥15 VB.NET如何绘制倾斜的椭圆