logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: https of one domain points me to the https of another domain
Author
Morales



Joined: 27 May 2020
Posts: 1
Location: Cordoba

PostPosted: Wed 27 May '20 18:04    Post subject: https of one domain points me to the https of another domain Reply with quote

I have two domains in my vps:

raton-inalambrico and rolsbek.

I have installed a ssl with letsencrypt for each one.

But when I put https:/www.rolsbek.com it redirects me to https:/www.raton-inalambrico.com.es

This doesn't happen with the http because I have two *80 ports for each domain.

The thing is that I don't know how to do it to create a 443 port for each domain or how it goes so that it doesn't redirect me from rolsbek's https to the one of mouse-wireless.

I use to manage ISPConfig

I'm waiting for your help, THANK YOU in advance.

Ports.conf
Code:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
# NameVirtualHost *:80
# NameVirtualHost *:443


000-default-conf

Code:
<VirtualHost *:80>
        ServerName www.rolsbek.com
      ServerAlias www.www.rolsbek.com
      ServerAdmin webmaster@www.rolsbek.com
        DocumentRoot /var/www/www.rolsbek.com/web
       
        ErrorLog /var/log/ispconfig/httpd/www.rolsbek.com/error.log

      Alias /error/ "/var/www/www.rolsbek.com/web/error/"
      ErrorDocument 400 /error/400.html
      ErrorDocument 401 /error/401.html
      ErrorDocument 403 /error/403.html
      ErrorDocument 404 /error/404.html
      ErrorDocument 405 /error/405.html
      ErrorDocument 500 /error/500.html
      ErrorDocument 502 /error/502.html
      ErrorDocument 503 /error/503.html
       
        Redirect permanent / https://www.rolsbek.com/
    </VirtualHost>
   
    <VirtualHost *:80>
        ServerName www.raton-inalambrico.com.es
      ServerAlias www.raton-inalambrico.com.es
      ServerAdmin webmaster@www.raton-inalambrico.com.es
        DocumentRoot /var/www/www.raton-inalambrico.com.es/web
       
        ErrorLog /var/log/ispconfig/httpd/www.raton-inalambrico.com.es/error.log

      Alias /error/ "/var/www/www.raton-inalambrico.com.es/web/error/"
      ErrorDocument 400 /error/400.html
      ErrorDocument 401 /error/401.html
      ErrorDocument 403 /error/403.html
      ErrorDocument 404 /error/404.html
      ErrorDocument 405 /error/405.html
      ErrorDocument 500 /error/500.html
      ErrorDocument 502 /error/502.html
      ErrorDocument 503 /error/503.html
       
        Redirect permanent / https://www.raton-inalambrico.com.es/
    </VirtualHost>

<VirtualHost *:443>
    ServerName www.rolsbek.com
    DocumentRoot /var/www/www.rolsbek.com/web
    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/www.rolsbek.com/cert.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/www.rolsbek.com/privkey.pem"
    SSLCertificateChainFile "/etc/letsencrypt/live/www.rolsbek.com/chain.pem"
</VirtualHost>

<VirtualHost *:443>
    ServerName www.raton-inalambrico.com.es
    DocumentRoot /var/www/www.raton-inalambrico.com.es/web
    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/www.raton-inalambrico.com.es/cert.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/www.raton-inalambrico.com.es/privkey.pem"
    SSLCertificateChainFile "/etc/letsencrypt/live/www.raton-inalambrico.com.es/chain.pem"
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


default-ssl.conf

Code:
<VirtualHost *:443>
    ServerName www.rolsbek.com
    DocumentRoot /var/www/www.rolsbek.com/web
    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/www.rolsbek.com/cert.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/www.rolsbek.com/privkey.pem"
    SSLCertificateChainFile "/etc/letsencrypt/live/www.rolsbek.com/chain.pem"
</VirtualHost>

<VirtualHost *:443>
    ServerName www.raton-inalambrico.com.es
    DocumentRoot /var/www/www.raton-inalambrico.com.es/web
    SSLEngine on
    SSLCertificateFile "/etc/letsencrypt/live/www.raton-inalambrico.com.es/cert.pem"
    SSLCertificateKeyFile "/etc/letsencrypt/live/www.raton-inalambrico.com.es/privkey.pem"
    SSLCertificateChainFile "/etc/letsencrypt/live/www.raton-inalambrico.com.es/chain.pem"
</VirtualHost>
   
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Fri 05 Jun '20 15:03    Post subject: Reply with quote

In each Port 80 vhost

Code:

RewriteEngine On
RewriteCond %{HTTPS}  !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
Back to top


Reply to topic   Topic: https of one domain points me to the https of another domain View previous topic :: View next topic
Post new topic   Forum Index -> Apache