简体   繁体   English

Ubuntu-如何直接将example.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?

I just created a website on VPS using Ubuntu and installed OpenCart. 我刚刚使用Ubuntu在VPS上创建了一个网站,并安装了OpenCart。 When i open it appears like this, http://example.com/opencart/index.php . 当我打开时,它看起来像这样, http://example.com/opencart/index.php Is there a way to shorten or direct to http://example.com and www.example.com ? 有没有一种方法可以缩短或定向到http://example.com和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 I Wayan Arthana

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> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用.htaccess将http://example.com/test.php设置为http://example.com/index.php?do=test? - How to make http://example.com/test.php to http://example.com/index.php?do=test using .htaccess? 如何将example.com/forum/index.php重定向到example.com/forum/ - How to redirect example.com/forum/index.php to example.com/forum/ 如何将example.com/index.php/lib更改为example.com/lib? - How to change example.com/index.php/lib to example.com/lib? 为什么“www.example.com”与“example.com”不一样? - Why is “www.example.com” not the same as “example.com”? example.com和www.example.com被视为不同的会话 - example.com and www.example.com are treated as different sessions 在example.com中使用setcookie(),在www.example.com中找不到cookie - setcookie() in example.com, cookie not found in www.example.com Avoid multiple page redirects http://example.com &gt; https://example.com -&gt; https://www.example.com - Avoid multiple page redirects http://example.com > https://example.com -> https://www.example.com 为什么Cookie只发送到http://www.example.com而不是http://example.com? - Why are cookies only sent to http://www.example.com and NOT http://example.com? 将example.com/dashboard.php更改为example.com/index.php?action=dashboard - Change example.com/dashboard.php to example.com/index.php?action=dashboard 是否可以将 example.com/index.php?page=abc 重定向到 example.com/abc? - Is it possible to redirect the example.com/index.php?page=abc to example.com/abc?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM