Redirect

Discussion in 'ISPConfig 3 Priority Support' started by francoisPE, Oct 25, 2021.

  1. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Hello,
    I would like to set a redirection from support.dom.tld to www.dom.tld/toto/tata/tutu/index.php
    I did it simply :
    I create a website called support.dom.tld.
    I choose redirect 301,L and proxy
    But...
    When opening browser calling support.dom.tld, at the very end, I have www.dom.tld/toto/tata/tutu/index.php in address bar.
    I would like support.dom.tld

    when opening the page as my browser should call www.dom.tld/toto/includes/jquery/css/base/jquery-ui.css, it becomes nothing good with support.dom.tld !

    Is that possible to keep support.dom.tld ?
    Could I use apache snipset ?

    Many thanks
     
    Last edited: Oct 25, 2021
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    You can try setting the support.dom.tld redirect type to 'proxy' and set redirect path to http://www.dom.tld/toto/tata/tutu/ (or try https) .. that will add a RewriteRule to proxy that site; anything needed beyond that would require custom apache directives.
     
  3. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I did that but css and js in not uploaded.
    It is requesting both (css and js) at "https://suport.dom.tld/toto/tata..."
    I need a rewrite rule for js css and others ...
    Not sure I will succeed in. Let's try !
     
  4. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I try that, as apache snipset

    <IfModule mod_rewrite.c>
    SSLProxyEngine On
    RewriteCond %{HTTP_HOST} ^support\.dom\.fr(.*)$ [NC]
    RewriteRule ^/(.*)[toto](.*)$ https://www.dom.fr/$1 [proxy, L]
    RewriteRule ^/(.*)$ https://www.dom.fr/toto/tata/tutu/$1 [proxy, L]
    </IfModule>

    But I have a vhost error !
    ld /etc/apache*/*/support.dom.fr.vhost*
    -rw-r--r-- 1 root root 6460 Oct 25 21:19 /etc/apache2/sites-available/support.dom.fr.vhost.err
    -rw-r--r-- 1 root root 6417 Oct 25 21:19 /etc/apache2/sites-available/support.dom.fr.vhost

    I don't know if I can combine proxy and L...
    How can I manage that ?
     
  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Using 'proxy' implies 'L', see the above link.
     
  7. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I DID it !

    Code:
    SSLProxyEngine On
    ProxyPassMatch   ^/toto/(.*)$ https://www.dom.fr/toto/$1 
    ProxyPass         / https://www.dom.fr/toto/tata/tutu/
    ProxyPassReverse  / https://www.dom.fr/
    
    :):):)o_O
    Manyyy thanks
     
    ahrasis and Jesse Norell like this.

Share This Page