New way to handle co-domain rewrite + bugfix of apache directives

Discussion in 'Feature Requests' started by Norman, May 9, 2006.

  1. Norman

    Norman Member HowtoForge Supporter

    I propose a change of how rewrites are added by changing it so it doesnt do:

    Code:
    RewriteCond %{HTTP_HOST}   ^testdomain\.xh\.se [NC]
    RewriteRule   ^/(.*)$  http://bigfoot.xh.se/forward/to/this/dir/$1  [R]
    
    Instead it should do:

    Code:
    RewriteCond    %{HTTP_HOST}  ^testdomain\.xh\.se
    RewriteRule    ^(.*)$        /var/www/webID/web/forward/to/this/dir/$1 [L]
    
    What this would do is simply create co-domains with true paths.
    http://testdomain.xh.se
    instead of
    http://otherdomain.xh.se/forward/to/this/dir/

    This would not pose a security threat as I see it.

    If the old style behaviour is wanted, then it should have a separate forward option.


    Also, I do not know if this is per design. But when changing apache directives it seems to be stripping out backslashes when the apache directive is read from database back to the client. Saving again will cause the backslashes to be removed.

    Code:
    RewriteCond %{HTTP_HOST}   ^testdomain\.xh\.se [NC]
    RewriteRule   ^/(.*)$  http://bigfoot.xh.se/forward/to/this/dir/$1  [R]
    
    would become

    Code:
    RewriteCond %{HTTP_HOST}   ^testdomain.xh.se [NC]
    RewriteRule   ^/(.*)$  http://bigfoot.xh.se/forward/to/this/dir/$1  [R]
    
    Edit... The bug I noted seems to be related and already reported at http://www.howtoforge.com/forums/showthread.php?t=907
     
    Last edited: May 9, 2006
  2. falko

    falko Super Moderator Howtoforge Staff

  3. Norman

    Norman Member HowtoForge Supporter

    What do you think about the rewrite proposal?
    Is it unthinkably stupid? ;)
     
  4. falko

    falko Super Moderator Howtoforge Staff

    We had some issues with this kind of forward (but I can't remember trhem anymore... :eek: ), that's why we changed it to how it is working now...
     
  5. Norman

    Norman Member HowtoForge Supporter

    Are there any logs of the issues?

    The ispconfig template seems to strip out {} and \ so I've bypassed this by adding it to apache directives as an include.
     

Share This Page