Ubuntu - 如何直接将示例.com/opencart/index.php 转换为 http://example.com/ 和 www.example.com?

Ubuntu - How direct example.com/opencart/index.php to http://example.com/ and www.example.com?

我刚刚使用 Ubuntu 在 VPS 上创建了一个网站并安装了 OpenCart。当我打开它时,它看起来像这样,http://example.com/opencart/index.php. Is there a way to shorten or direct to http://example.com 和 www.example.com ?

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

谢谢,

我是 Wayan Arthana

可以设置虚拟主机吹:

阿帕奇:

<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>