Redirect tab bug?

Discussion in 'Installation/Configuration' started by Steffan, Oct 11, 2016.

  1. Steffan

    Steffan Member

    When creating a new site in 3.1

    select Redirect type R=301,L
    redirect path empty
    SEO redirect domain.tld => www.domain.tld
    Rewrite http to https On

    The www redirect is not created in the config:

    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Works fine here in ISPConfig 3.1 on Apache 2.4. Btw, your settings are inconsistent as it makes no sense to select a redirect type without the ath to which this redirect shall happen, so when redirect path is empty, then set the Redirect type to no redirect as your redirect will nt get added anyway without the path.
     
  3. Steffan

    Steffan Member

    hm i always use this settings to redirect domain.com to www.domain.com
    in 3.0 it added:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
    RewriteRule ^(.*)$ https://www.domain.com$1 [R=301,NE,L]

    to the config
    And that is still working.

    i take this from the (old) manual

    SEO Redirect: Here you can do search-engine optimization for your website and configure a redirect to avoid
    duplicate content. You can redirect your non-www website to your www website (e.g. visitors to example.com
    will be redirected permanently to www.example.com) or vice versa (www.example.com to example.com).
    These are the options:

    If you want to do a URL redirect, please specify the redirect target URL in the Redirect Path field (e.g.
    http://www.someotherwebsite.com/subdir/ or http://www.someotherwebsite.com/). Please note
    that the URL should have a trailing slash:
     
    Last edited: Oct 11, 2016
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    As you see, the manual confirms what I told you in post #2 about the target URL. I can only verify that the above function works properly in iSPConfig 3.1 on my servers, if it does not work on your system then you might use a custom vhost template that is not compatible with 3.1.

    Here is the redirect config written by a stock ispconfig 3.1 system:

    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
    RewriteRule ^ - [END]
    RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com$1 [R=301,NE,L]
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
     

Share This Page