[Solved] Alias Domain don't work

Discussion in 'General' started by MikySal78, Dec 13, 2019.

  1. MikySal78

    MikySal78 Member

    I migrate from server with IspConfig and Debian 9 to IspConfig and debian 10.
    I add alias domain with redirect but don'work.
    I see the file in virtualhost and i have
    RewriteCond %{HTTP_HOST} (^|\.)promo\.offerta\.in$ [NC]
    RewriteRule ^/(.*)$ https://www.offerta.in/p [R=301,L]

    On debian 9 is ok, debian 10 no.
    do you have a suggestion?
    Thanks.
     
  2. Steini86

    Steini86 Active Member

    What exactly does not work? Any error messages? What happens vs what is your expected behaviour?
     
  3. MikySal78

    MikySal78 Member

    I didn't find anything in the logs.
    The rewrite was from promo.offerta.in to offerta.in/p
    This on debian 9 is ok, debian 10 no.
    redirect on offerta.in homepage not /p ...
     
  4. Steini86

    Steini86 Active Member

    Ah, so the server etc is working. It is redirecting. But instead of redirecting to the subfolder, it is redirecting to the main site (?)

    Try, if it works when you edit the file to:
    Code:
    RewriteCond %{HTTP_HOST} (^|\.)promo\.offerta\.in$ [NC]
    RewriteRule ^/(.*)$ https://www.offerta.in/p/$1 [R=301,L]
     
  5. MikySal78

    MikySal78 Member

    idem, don't redirect.

    Main site is offerta.in
    I want..if digit promo.offerta.in -> offerta.in/p
     
  6. Steini86

    Steini86 Active Member

    At the moment promo.offerta.in is redirecting with code 301 to http://www.offerta.in/ which is denn forwarding with 302 to https://www.offerta.in/

    It looks like you have configured 2 or more redirects in different config files. Can you make a screenshot of the setting you have made?
     
  7. MikySal78

    MikySal78 Member

     

    Attached Files:

  8. Steini86

    Steini86 Active Member

  9. MikySal78

    MikySal78 Member

  10. Steini86

    Steini86 Active Member

    Do you have any additional redirecty configured, for example in a .htaccess file?
    have you changed http to https on the redirect?

    In your vhost configuration I can see an earlier redirect to www.offerta.in, but that 'should'(?) only effect offerta.in -> www.offerta.in, not promo.offerta.in. For a test, you could delete these two lines from your vhost config and try if that works then.
    Don't forget to reload apache2 when doing these changes.
     
  11. MikySal78

    MikySal78 Member

    i remove seo redirect from ispconfig, check on shell and see:
    Code:
            RewriteEngine on
            RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
            RewriteRule ^ - [END]
            RewriteCond %{HTTP_HOST}   ^promo\.offerta\.in$ [NC]
            RewriteRule   ^/(.*)$ http://www.offerta.in/p/$1  [R=301,L]
    
    restart apache2 but don't work.

    for .htaccess is websiste on framwork lavarel and this is code:
    Code:
    <IfModule mod_rewrite.c>
        <IfModule mod_negotiation.c>
            Options -MultiViews
        </IfModule>
    
        RewriteEngine On
    
        # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)/$ /$1 [L,R=301]
    
        # Handle Front Controller...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    
        # Handle Authorization Header
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    </IfModule>
    
     
  12. MikySal78

    MikySal78 Member

    On debian stretch with ispconfig 3.1.15 work!
    On debian buster with ispconfig 3.1.15p2 don't work.
    i copy website and settings from old server to new server... bug of 3.1.15p2?
     
  13. Steini86

    Steini86 Active Member

    Very unlikely.

    It seems to work now. I think it is a cache problem of your browser. Code 301 tells your browser "Moved Permanently (to new location)". Therefore, the browser saved the old redirect and is showing you the saved site. Try with incognito mode of your browser, or clear cache. Should work now (at least does for me).
     
    MikySal78 likes this.
  14. MikySal78

    MikySal78 Member

    Solved.... thanks!
     
    Steini86 likes this.

Share This Page