【问题标题】:Ubuntu - How direct example.com/opencart/index.php to http://example.com/ and www.example.com?Ubuntu - 如何将 example.com/opencart/index.php 直接连接到 http://example.com/ 和 www.example.com?
【发布时间】:2018-08-19 05:53:35
【问题描述】:

我刚刚使用 Ubuntu 在 VPS 上创建了一个网站并安装了 OpenCart。当我打开它时,它看起来像这样,http://example.com/opencart/index.php。有没有办法缩短或直接到http://example.com 和 www.example.com ?

也许我错过了一些我必须做的设置。请有人帮我一步一步解决这个问题,因为我刚刚学会了创建一个网站。

谢谢,

我是瓦扬·阿尔萨纳

【问题讨论】:

    标签: php web ubuntu-16.04 vps opencart-3


    【解决方案1】:

    你可以设置虚拟主机打击:

    阿帕奇:

    <VirtualHost *:80>  
        DocumentRoot "/home/xxx/opencart"  
        ServerName myvirtualhost.com  
        DirectoryIndex index.html  index.php
        <Directory "/home/xxx/opencart">  
        Options -Indexes FollowSymLinks  
        AllowOverride None  
        Order allow,deny  
        Allow from all  
        </Directory>  
        ErrorLog "logs/myvirtualhost.com-error.log"  
        CustomLog "logs/myvirtualhost.com-access.log" common  
    </VirtualHost> 
    

    【讨论】:

    • 谢谢你的回答,“/home/xxx/opencart”应该填什么?,像这样的/var/www/html或其他是什么意思
    • 你的服务器是什么?如果是apache,可以编辑文件:/usr/loca/apche/etc/httpd.conf
    • Apache2 那是我的服务器
    • 您应该编辑配置文件。路径可能是 /usr/loca/apche/etc/httpd.conf
    • 好的,谢谢 lyq,我现在想试试。如果我发现错误,你能再帮我一次吗:)
    猜你喜欢
    • 2016-01-16
    • 2020-09-24
    • 1970-01-01
    • 2014-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-17
    • 1970-01-01
    相关资源
    最近更新 更多