https domain redirection

Discussion in 'General' started by zineDzine, Aug 11, 2017.

  1. zineDzine

    zineDzine New Member

    Hi,
    I have an issue with the redirection of the apache standar page, the famous "it works".
    the url of my dedicated server is http://dedicatedurl.tld and https://dedicatedurl.tld,
    it point to the ispconfig apache standard page. i would like to get it to point towards a specifique website.
    the website is, mysite.tld
    i want to redirect the dedicated server name to my website basically.
    i configured the domain alias via the web interface of mysite.tld.
    i added :
    - domain : dedicatedurl.tld
    - parent : mysite.tld
    - redirect type : R=301,L
    - redirect path : https://www.mysite.tld/
    - auto subdomain : none
    - SEO redirect : No redirect
    - active : yes
    http://dedicatedurl.tld/ to https://www.mysite.tld/ (works)
    https://dedicatedurl.tld/ to https://www.mysite.tld/ (not working)
    how can i get the https to also work.
    regards.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    What means not working (exact error)?
     
  3. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Hi,
    are you using Let's Encrypt on the domain(s)?
    Could you please post the output of apache2ctl -S ? Mostly those errors are related to ip/non-ip mixed settings.
     
  4. zineDzine

    zineDzine New Member

    Hi,

    yes i am using let's encrypt,

    There is no error, just :

    when i point to the dedicated URL in http, it does redirect to mysites url in https, but if i point to the dedicated URL i https it does not redirect. It remains the same error.
    http://dedicatedurl.tld/ to https://www.mysite.tld/ (works)
    https://dedicatedurl.tld/ to https://www.mysite.tld/ (not working)

    here the result of apache2ctl -S.

    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:72
    VirtualHost configuration:
    *:8081 ispconfig.mysite.tld (/etc/apache2/sites-enabled/000-apps.vhost:9)
    *:8080 ispconfig.mysite.tld (/etc/apache2/sites-enabled/000-ispconfig.vhost:9)
    *:80 is a NameVirtualHost
    default server ispconfig.mysite.tld (/etc/apache2/sites-enabled/000-default.conf:1)
    port 80 namevhost ispconfig.mysite.tld (/etc/apache2/sites-enabled/000-default.conf:1)
    port 80 namevhost mysite.tld (/etc/apache2/sites-enabled/100-mysite.tld.vhost:7)
    alias www.mysite.tld
    alias dedicatedurl.tld
    *:443 mysite.tld (/etc/apache2/sites-enabled/mysite.tld.vhost-le-ssl.conf:2)
    ServerRoot: "/etc/apache2"
    Main DocumentRoot: "/var/www/html"
    Main ErrorLog: "/var/log/apache2/error.log"
    Mutex ssl-stapling: using_defaults
    Mutex proxy: using_defaults
    Mutex ssl-cache: using_defaults
    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
    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
     
  5. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    As you can see in the output of apache2ctl -S there is no HTTPS domain for dedicatedurl.tld
    You have used LE not INSIDE of ISPConfig but as standalone, so this messes up your config. You must never use LE outside of ISPConfig because you will definitively mess up the vhost files.
     
  6. zineDzine

    zineDzine New Member

    Ok, i will remove my redirection and see how i can get it done différently ... Thanks for the reply.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The redirect is not the problem here. The problem is that you used LE outside of ISPConfig instead of enabling LE for the website in ISPConfig. Your manual use of LE created the file /etc/apache2/sites-enabled/mysite.tld.vhost-le-ssl.conf which now messes up the setup. Remove that file and then enable LE in the website settings instead.
     

Share This Page