简体   繁体   English

如何使用HTTP和HTTPS在同一域中运行不同的网站

[英]How to run different website in a same domain with HTTP and HTTPS

Can i run different websites in same domain. 我可以在同一个域中运行不同的网站吗? like 喜欢

http://www.example.com ----> in WordPress
https://example.com/ -----> in laravel

Here is the reference site 这是参考站点

Website : www.linqs.in              
APP:    https://linqs.in/username

App url will open user's profile by provided username. 应用网址将通过提供的用户名打开用户的个人资料。

sorry if i made mistake !! 对不起,如果我弄错了! if this possible please guide me. 如果可以的话,请指导我。

由于URL侦听端口,例如http-端口80,https-端口443。因此,您可以通过VirtualHost configure确保同一域中的其他网站。

You can do this in your virtual host configuration : 您可以在虚拟主机配置中执行此操作:

Listen 80
Listen 443

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot "/path/to/wordpress"
</VirtualHost>

<VirtualHost *:443>
    ServerName example.com
    DocumentRoot "/path/to/laravel/public"
</VirtualHost>

You may also need to define directories if the sources are not under your default http root. 如果源不在默认的http根目录下,则可能还需要定义目录。 For example: 例如:

<VirtualHost *:443>
    ServerName example.com
    DocumentRoot "/path/to/laravel"
    <Directory /path/to/laravel>
          AllowOverride All
    </Directory>
</VirtualHost>

This will also allow Apache to serve that directory and use any .htaccess files (if it wasn't allowed already). 这也将允许Apache服务该目录并使用任何.htaccess文件(如果尚未允许)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM