Www to non www (maybe http to https) redirect problem

Discussion in 'ISPConfig 3 Priority Support' started by faberchr, Nov 12, 2018.

  1. faberchr

    faberchr Member

    Hello,
    I am here again because I have another problem regarding http/https www/non www domains. Basically, I use both LE and www-to-non www redirect on two domains:
    • abc.com
    • xyz.com
    with this configuration only https://xyz.com works, because:
    On the shell I did a
    Code:
    wget http://ab.com
    
    and I noticed that the index.html has this redirect:
    Code:
    window.location.replace("https://abc.com");
    
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I did not understand what is the problem you want help with?
     
  3. faberchr

    faberchr Member

    The problem is this: I would like to point http(s)://(www.)xyz.com to https://xyz.com, but Apache seems to redirect to another websites.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    To redirect an https URL, this domain must have a valid SSL cert. Did you enable SSL for the domain that you are redirecting? The target domain must have a valid SSL cert too.

    If the source or target domain has no valid SSL cert, then apache will show the content of the first page with SSL enabled that uses the same IP address. So the problem that you describe is most likely related to a missing or non-enabled ssl cert for one of the domains.
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    ISPConfig website has in redirect tab setting for http to https. If there are other redirects, remove those (unless you want them also).
    If your website content does redirects, you should edit the files and fix the redirects you do not want.
     
  6. faberchr

    faberchr Member

    Thanks for your reply. I did a check before posting and the answer is: yes both domains have SSL enabled. I unchecked the SSL and LE checkbox, waited and then checked again, but nothing happened.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then please describe what you configured exactly. Are both domains websites or is one domain an alias domain of another site and what did you configure on the redirect tabs and which software do you run in that site (as cms systems like WordPress do redirects on their own).
     
  8. faberchr

    faberchr Member

    Both domains are websites. Each domain uses A record to point to the server's IP.
    Domain abc.com
    • IPv4 Address: *
    • Domain: abc.com
    • Autosubdomain: none
    • SSL: Checked
    • Let's Encrypt: checked
    • PHP: Fast-CGI (default)
    • Redirect: R=301, L
    • Seo-redirect: www.domain.tld => domain.tld
    • Rewrite http to https: checked
    Domain xyz.com (the one with problems)
    • IPv4 Address: *
    • Domain: xyz.com
    • Autosubdomain: none
    • SSL: Checked
    • Let's Encrypt: checked
    • PHP: Fast-CGI (default)
    • Redirect: R=301, L
    • Seo-redirect: www.domain.tld => domain.tld
    • Rewrite http to https: checked
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Redirect needs to be set to no-redirect for both domains as you are not doing any redirect. The seo redirect is a config option on its own while redirect is used in conjunction with redirect path, see manual for details. So when you are just doing a seo redirect, then redirect needs to be set to no-redirect.

    If changing this setting does not fix the problem, then please post the vhost config files of both websites.
     
  10. faberchr

    faberchr Member

    Thanks, unfortunately this has no effect.
    Code:
    [email protected]:~# apachectl -S
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:73
    VirtualHost configuration:
    *:8081                 xx.xx.xx.xx.vultr.com (/etc/apache2/sites-enabled/000-apps.vhost:9)
    *:8080                 xx.xx.xx.xx.vultr.com (/etc/apache2/sites-enabled/000-ispconfig.vhost:9)
    *:80                   is a NameVirtualHost
             default server xx.xx.xx.xx.vultr.com (/etc/apache2/sites-enabled/000-default.conf:1)
             port 80 namevhost xx.xx.xx.xx.vultr.com (/etc/apache2/sites-enabled/000-default.conf:1)
             port 80 namevhost abc.com (/etc/apache2/sites-enabled/100-abc.com.vhost:7)
             port 80 namevhost xyz.com (/etc/apache2/sites-enabled/100-xyz.com.vhost:7)
    *:443                  is a NameVirtualHost
             default server abc.com (/etc/apache2/sites-enabled/100-abc.com.vhost:150)
             port 443 namevhost abc.com (/etc/apache2/sites-enabled/100-abc.com.vhost:150)
             port 443 namevhost xyz.com (/etc/apache2/sites-enabled/100-xyz.com.vhost:123)
    ServerRoot: "/etc/apache2"
    Main DocumentRoot: "/var/www/html"
    Main ErrorLog: "/var/log/apache2/error.log"
    Mutex default: dir="/var/run/apache2/" mechanism=default
    Mutex mpm-accept: using_defaults
    Mutex fcgid-pipe: using_defaults
    Mutex authdigest-opaque: using_defaults
    Mutex watchdog-callback: using_defaults
    Mutex rewrite-map: using_defaults
    Mutex ssl-stapling-refresh: using_defaults
    Mutex authdigest-client: using_defaults
    Mutex fcgid-proctbl: using_defaults
    Mutex ssl-stapling: using_defaults
    Mutex proxy: using_defaults
    Mutex ssl-cache: using_defaults
    PidFile: "/var/run/apache2/apache2.pid"
    Define: DUMP_VHOSTS
    Define: DUMP_RUN_CFG
    Define: ENABLE_USR_LIB_CGI_BIN
    User: name="www-data" id=33
    Group: name="www-data" id=33
    [email protected]:~#
    
     
  11. faberchr

    faberchr Member

    ABC.com
    =====
    Code:
    [email protected]:~# cat /etc/apache2/sites-enabled/100-abc.com.vhost
    
    <Directory /var/www/abc.com>
                    AllowOverride None
                                    Require all denied
                    </Directory>
    
    <VirtualHost *:80>
    
                                                                            DocumentRoot /var/www/abc.com/web
    
                    ServerName abc.com
                    ServerAdmin [email protected]
    
    
                    ErrorLog /var/log/ispconfig/httpd/abc.com/error.log
    
                    Alias /error/ "/var/www/abc.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
    
                    <IfModule mod_ssl.c>
                    </IfModule>
    
                    <Directory /var/www/abc.com/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
    
                                    # ssi enabled
                                    AddType text/html .shtml
                                    AddOutputFilter INCLUDES .shtml
                                    Options +Includes
                    </Directory>
                    <Directory /var/www/clients/client1/web1/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
    
                                    # ssi enabled
                                    AddType text/html .shtml
                                    AddOutputFilter INCLUDES .shtml
                                    Options +Includes
                    </Directory>
    
    
    
    
                    # cgi enabled
            <Directory /var/www/clients/client1/web1/cgi-bin>
                                                    Require all granted
                                            </Directory>
                    ScriptAlias  /cgi-bin/ /var/www/clients/client1/web1/cgi-bin/
                    <FilesMatch "\.(cgi|pl)$">
                            SetHandler cgi-script
                    </FilesMatch>
                    # suexec enabled
                    <IfModule mod_suexec.c>
                            SuexecUserGroup web1 client1
                    </IfModule>
                    # php as fast-cgi enabled
            # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
                    <IfModule mod_fcgid.c>
                                    FcgidIdleTimeout 300
                                    FcgidProcessLifeTime 3600
                                    # FcgidMaxProcesses 1000
                                    FcgidMaxRequestsPerProcess 5000
                                    FcgidMinProcessesPerClass 0
                                    FcgidMaxProcessesPerClass 10
                                    FcgidConnectTimeout 3
                                    FcgidIOTimeout 600
                                    FcgidBusyTimeout 3600
                                    FcgidMaxRequestLen 1073741824
                    </IfModule>
                    <Directory /var/www/abc.com/web>
                                    <FilesMatch "\.php[345]?$">
                                            SetHandler fcgid-script
                                    </FilesMatch>
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php3
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php4
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php5
                                    Options +ExecCGI
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client1/web1/web>
                                    <FilesMatch "\.php[345]?$">
                                            SetHandler fcgid-script
                                    </FilesMatch>
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php3
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php4
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php5
                                    Options +ExecCGI
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
                    RewriteEngine on
                    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
                    RewriteRule ^ - [END]
                    RewriteCond %{HTTP_HOST} ^www\.cartashopping\.com$ [NC]
                                    RewriteRule ^(.*)$ http://abc.com$1 [R=301,NE,L]
            RewriteCond %{HTTPS} off
                    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
    
                    # add support for apache mpm_itk
                    <IfModule mpm_itk_module>
                            AssignUserId web1 client1
                    </IfModule>
    
                    <IfModule mod_dav_fs.c>
                    # Do not execute PHP files in webdav directory
                            <Directory /var/www/clients/client1/web1/webdav>
                                    <ifModule mod_security2.c>
                                            SecRuleRemoveById 960015
                                            SecRuleRemoveById 960032
                                    </ifModule>
                                    <FilesMatch "\.ph(p3?|tml)$">
                                            SetHandler None
                                    </FilesMatch>
                            </Directory>
                            DavLockDB /var/www/clients/client1/web1/tmp/DavLock
                            # DO NOT REMOVE THE COMMENTS!
                            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                            # WEBDAV END
                    </IfModule>
    
    
    
    </VirtualHost>
    
     
  12. faberchr

    faberchr Member

    ABC.COM:443
    ====
    Code:
    <VirtualHost *:443>
    
                                                                            DocumentRoot /var/www/abc.com/web
    
                    ServerName abc.com
                    ServerAdmin [email protected]
    
    
                    ErrorLog /var/log/ispconfig/httpd/abc.com/error.log
    
                    Alias /error/ "/var/www/abc.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
    
                    <IfModule mod_ssl.c>
                    SSLEngine on
                    SSLProtocol All -SSLv2 -SSLv3
                    # SSLCipherSuite          ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
                    SSLHonorCipherOrder     on
                    # <IfModule mod_headers.c>
                    # Header always add Strict-Transport-Security "max-age=15768000"
                    # </IfModule>
                    SSLCertificateFile /var/www/clients/client1/web1/ssl/abc.com-le.crt
                    SSLCertificateKeyFile /var/www/clients/client1/web1/ssl/abc.com-le.key
                                    SSLCertificateChainFile /var/www/clients/client1/web1/ssl/abc.com-le.bundle
                                                    SSLUseStapling on
                    SSLStaplingResponderTimeout 5
                    SSLStaplingReturnResponderErrors off
                                    </IfModule>
    
                    <Directory /var/www/abc.com/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
    
                                    # ssi enabled
                                    AddType text/html .shtml
                                    AddOutputFilter INCLUDES .shtml
                                    Options +Includes
                    </Directory>
                    <Directory /var/www/clients/client1/web1/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
    
                                    # ssi enabled
                                    AddType text/html .shtml
                                    AddOutputFilter INCLUDES .shtml
                                    Options +Includes
                    </Directory>
    
    
    
    
                    # cgi enabled
            <Directory /var/www/clients/client1/web1/cgi-bin>
                                                    Require all granted
                                            </Directory>
                    ScriptAlias  /cgi-bin/ /var/www/clients/client1/web1/cgi-bin/
                    <FilesMatch "\.(cgi|pl)$">
                            SetHandler cgi-script
                    </FilesMatch>
                    # suexec enabled
                    <IfModule mod_suexec.c>
                            SuexecUserGroup web1 client1
                    </IfModule>
                    # php as fast-cgi enabled
            # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
                    <IfModule mod_fcgid.c>
                                    FcgidIdleTimeout 300
                                    FcgidProcessLifeTime 3600
                                    # FcgidMaxProcesses 1000
                                    FcgidMaxRequestsPerProcess 5000
                                    FcgidMinProcessesPerClass 0
                                    FcgidMaxProcessesPerClass 10
                                    FcgidConnectTimeout 3
                                    FcgidIOTimeout 600
                                    FcgidBusyTimeout 3600
                                    FcgidMaxRequestLen 1073741824
                    </IfModule>
                    <Directory /var/www/abc.com/web>
                                    <FilesMatch "\.php[345]?$">
                                            SetHandler fcgid-script
                                    </FilesMatch>
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php3
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php4
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php5
                                    Options +ExecCGI
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client1/web1/web>
                                    <FilesMatch "\.php[345]?$">
                                            SetHandler fcgid-script
                                    </FilesMatch>
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php3
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php4
                                    FCGIWrapper /var/www/php-fcgi-scripts/web1/.php-fcgi-starter .php5
                                    Options +ExecCGI
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
                    RewriteEngine on
                    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
                    RewriteRule ^ - [END]
                    RewriteCond %{HTTP_HOST} ^www\.cartashopping\.com$ [NC]
                                    RewriteRule ^(.*)$ https://abc.com$1 [R=301,NE,L]
    
                    # add support for apache mpm_itk
                    <IfModule mpm_itk_module>
                            AssignUserId web1 client1
                    </IfModule>
    
                    <IfModule mod_dav_fs.c>
                    # Do not execute PHP files in webdav directory
                            <Directory /var/www/clients/client1/web1/webdav>
                                    <ifModule mod_security2.c>
                                            SecRuleRemoveById 960015
                                            SecRuleRemoveById 960032
                                    </ifModule>
                                    <FilesMatch "\.ph(p3?|tml)$">
                                            SetHandler None
                                    </FilesMatch>
                            </Directory>
                            DavLockDB /var/www/clients/client1/web1/tmp/DavLock
                            # DO NOT REMOVE THE COMMENTS!
                            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                            # WEBDAV END
                    </IfModule>
    
    
    
    </VirtualHost>
    
    <IfModule mod_ssl.c>
            SSLStaplingCache shmcb:/var/run/ocsp(128000)
    </IfModule>
    
    
     
  13. faberchr

    faberchr Member

    XYZ.COM
    ====
    Code:
    [email protected]:~# cat /etc/apache2/sites-enabled/100-xyz.com.vhost
    
    <Directory /var/www/xyz.com>
                    AllowOverride None
                                    Require all denied
                    </Directory>
    
    <VirtualHost *:80>
    
                                                                            DocumentRoot /var/www/xyz.com/web
    
                    ServerName xyz.com
                    ServerAdmin [email protected]
    
    
                    ErrorLog /var/log/ispconfig/httpd/xyz.com/error.log
    
    
                    <IfModule mod_ssl.c>
                    </IfModule>
    
                    <Directory /var/www/xyz.com/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client1/web3/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
    
    
                    # suexec enabled
                    <IfModule mod_suexec.c>
                            SuexecUserGroup web3 client1
                    </IfModule>
                    # php as fast-cgi enabled
            # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
                    <IfModule mod_fcgid.c>
                                    FcgidIdleTimeout 300
                                    FcgidProcessLifeTime 3600
                                    # FcgidMaxProcesses 1000
                                    FcgidMaxRequestsPerProcess 5000
                                    FcgidMinProcessesPerClass 0
                                    FcgidMaxProcessesPerClass 10
                                    FcgidConnectTimeout 3
                                    FcgidIOTimeout 600
                                    FcgidBusyTimeout 3600
                                    FcgidMaxRequestLen 1073741824
                    </IfModule>
                    <Directory /var/www/xyz.com/web>
                                    <FilesMatch "\.php[345]?$">
                                            SetHandler fcgid-script
                                    </FilesMatch>
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php3
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php4
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php5
                                    Options +ExecCGI
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client1/web3/web>
                                    <FilesMatch "\.php[345]?$">
                                            SetHandler fcgid-script
                                    </FilesMatch>
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php3
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php4
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php5
                                    Options +ExecCGI
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
                    RewriteEngine on
                    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
                    RewriteRule ^ - [END]
                    RewriteCond %{HTTP_HOST} ^www\.hostname\.com$ [NC]
                                    RewriteRule ^(.*)$ http://xyz.com$1 [R=301,NE,L]
            RewriteCond %{HTTPS} off
                    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
    
                    # add support for apache mpm_itk
                    <IfModule mpm_itk_module>
                            AssignUserId web3 client1
                    </IfModule>
    
                    <IfModule mod_dav_fs.c>
                    # Do not execute PHP files in webdav directory
                            <Directory /var/www/clients/client1/web3/webdav>
                                    <ifModule mod_security2.c>
                                            SecRuleRemoveById 960015
                                            SecRuleRemoveById 960032
                                    </ifModule>
                                    <FilesMatch "\.ph(p3?|tml)$">
                                            SetHandler None
                                    </FilesMatch>
                            </Directory>
                            DavLockDB /var/www/clients/client1/web3/tmp/DavLock
                            # DO NOT REMOVE THE COMMENTS!
                            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                            # WEBDAV END
                    </IfModule>
    
    
    
    </VirtualHost>
    
    
     
  14. faberchr

    faberchr Member

    XYZ.COM:443
    ====
    Code:
    <VirtualHost *:443>
    
                                                                            DocumentRoot /var/www/xyz.com/web
    
                    ServerName xyz.com
                    ServerAdmin [email protected]
    
    
                    ErrorLog /var/log/ispconfig/httpd/xyz.com/error.log
    
    
                    <IfModule mod_ssl.c>
                    SSLEngine on
                    SSLProtocol All -SSLv2 -SSLv3
                    # SSLCipherSuite          ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
                    SSLHonorCipherOrder     on
                    # <IfModule mod_headers.c>
                    # Header always add Strict-Transport-Security "max-age=15768000"
                    # </IfModule>
                    SSLCertificateFile /var/www/clients/client1/web3/ssl/xyz.com-le.crt
                    SSLCertificateKeyFile /var/www/clients/client1/web3/ssl/xyz.com-le.key
                                    SSLCertificateChainFile /var/www/clients/client1/web3/ssl/xyz.com-le.bundle
                                                    SSLUseStapling on
                    SSLStaplingResponderTimeout 5
                    SSLStaplingReturnResponderErrors off
                                    </IfModule>
    
                    <Directory /var/www/xyz.com/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client1/web3/web>
                                    # Clear PHP settings of this website
                                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                                                    SetHandler None
                                    </FilesMatch>
                                    Options +FollowSymLinks
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
    
    
                    # suexec enabled
                    <IfModule mod_suexec.c>
                            SuexecUserGroup web3 client1
                    </IfModule>
                    # php as fast-cgi enabled
            # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
                    <IfModule mod_fcgid.c>
                                    FcgidIdleTimeout 300
                                    FcgidProcessLifeTime 3600
                                    # FcgidMaxProcesses 1000
                                    FcgidMaxRequestsPerProcess 5000
                                    FcgidMinProcessesPerClass 0
                                    FcgidMaxProcessesPerClass 10
                                    FcgidConnectTimeout 3
                                    FcgidIOTimeout 600
                                    FcgidBusyTimeout 3600
                                    FcgidMaxRequestLen 1073741824
                    </IfModule>
                    <Directory /var/www/xyz.com/web>
                                    <FilesMatch "\.php[345]?$">
                                            SetHandler fcgid-script
                                    </FilesMatch>
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php3
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php4
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php5
                                    Options +ExecCGI
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
                    <Directory /var/www/clients/client1/web3/web>
                                    <FilesMatch "\.php[345]?$">
                                            SetHandler fcgid-script
                                    </FilesMatch>
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php3
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php4
                                    FCGIWrapper /var/www/php-fcgi-scripts/web3/.php-fcgi-starter .php5
                                    Options +ExecCGI
                                    AllowOverride All
                                                                    Require all granted
                                                    </Directory>
    
    
                    RewriteEngine on
                    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
                    RewriteRule ^ - [END]
                    RewriteCond %{HTTP_HOST} ^www\.hostname\.com$ [NC]
                                    RewriteRule ^(.*)$ https://xyz.com$1 [R=301,NE,L]
    
                    # add support for apache mpm_itk
                    <IfModule mpm_itk_module>
                            AssignUserId web3 client1
                    </IfModule>
    
                    <IfModule mod_dav_fs.c>
                    # Do not execute PHP files in webdav directory
                            <Directory /var/www/clients/client1/web3/webdav>
                                    <ifModule mod_security2.c>
                                            SecRuleRemoveById 960015
                                            SecRuleRemoveById 960032
                                    </ifModule>
                                    <FilesMatch "\.ph(p3?|tml)$">
                                            SetHandler None
                                    </FilesMatch>
                            </Directory>
                            DavLockDB /var/www/clients/client1/web3/tmp/DavLock
                            # DO NOT REMOVE THE COMMENTS!
                            # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                            # WEBDAV END
                    </IfModule>
    
    
    
    </VirtualHost>
    
    <IfModule mod_ssl.c>
            SSLStaplingCache shmcb:/var/run/ocsp(128000)
    </IfModule>
    
    
    
    [email protected]:~#
    
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Seems as if you copied the vhost files before you disabled the rewrite, otherwise they should not contain this line:

    RewriteRule ^(.*)$ https://xyz.com$1 [R=301,NE,L]

    But beside that, the files look fine and do not contain a redirect. Did you try to use a different browser? It might be that your browser has cached an old redirect. And if you have some kind of cms in these sites, then it might be that this cms, or a .htaccess file in the web folder of the sites, does that redirect.

    If you want that someone checks this remotely for you, contact Florian from ISPConfig Business support: https://www.ispconfig.org/get-support/?type=ispconfig
     
  16. faberchr

    faberchr Member

    Hello,
    both CMS were written by me, so I am sure that .htaccess is not the issue. I am trying to deep check the default page of Apache/Ubuntu.
     

Share This Page