Search code examples
phpwebubuntu-16.04vpsopencart-3

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


I just created a website on VPS using Ubuntu and installed OpenCart. When i open it appears like this, http://example.com/opencart/index.php. Is there a way to shorten or direct to http://example.com and www.example.com ?

Maybe i missed some setting that i had to do. Please someone help me step by step to solve this problem, and because i just learned to create a website.

Thank you,

I Wayan Arthana


Solution

  • you can set the virtual host blow:

    Apache:

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