Co-domain Recursive Redirection Fix

Discussion in 'Tips/Tricks/Mods' started by rdutton, Jan 19, 2007.

  1. rdutton

    rdutton New Member

    I wanted the following co-domains:
    - www.modelclassics.com
    - modelclassics.com
    - modelclassics.com.au
    To all forward to http://www.modelclassics.com.au, however the browser ended up recursively redirecting when going to any of these domain URLs. This is because using the standard ISPConfig setup, the domain 'www.modelclassics.com.au' also matches the 'www.modelclassics.com' domain forwarding rule.

    By changing line 1360 of scripts/lib/config.lib.php from:
    PHP:
    $rewrite_rule .= "\nRewriteCond %{HTTP_HOST}   ^".$rewrite_cond_url." [NC]";
    to
    PHP:
    $rewrite_rule .= "\nRewriteCond %{HTTP_HOST}   ^".$rewrite_cond_url.'$'." [NC]";
    the problem is solved.

    The additional '$' matches the end of the domain such that .com.au != .com.

    Not sure if this fix should be applied to the codebase?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no patch nescessary as it works out of the box. Just leave the redirect field of the co-domain empty. If a domain shall not redirect to a subdirectory or a domain of anotherw ebsite, this field must be empty.
     
  3. rdutton

    rdutton New Member

    Thanks for your feedback till, and normally I would just alias the domains as you suggested.

    There is a difference however between aliasing a domain, and being forwarded to one. When forwarding, the domain changes in the address bar. A subtle difference, but something my client wanted.
     
    Last edited: Jan 19, 2007

Share This Page