internal domain forwards

Discussion in 'Installation/Configuration' started by laqup, Nov 9, 2009.

  1. laqup

    laqup New Member

    Hi everybody,

    first of all: I'm new to ispconfig and this might be a pretty dumb question:
    I have a big problem configuring domains / domain-forwards.

    For example:
    I created a client and assigned a website to him.
    I used "web1" as hostnome and "mymanagementdomain.xxx" as domainname.
    => I can access the users default page located in /web/ with web1.mymanagementdomain.xxx.

    The client owns some real domains, thus I add these domains in the website under "co-domains" and specify a forward folder, e.g.: lolomg
    => When I type www.myclientdomain.xxx in my browser I'd like to be directed to this folder.
    Instead I am forwarded to web1.mymanagementdomain.xxx/lolomg/. This behaviour dirves me crazy. I really don't want to see the "managementdomain" or the forward-folder when opening the client-domain.
    Isn't there any way to do the routing internally?

    Thanks in advance,

    Best regards,
    Daniel
     
  2. falko

    falko Super Moderator ISPConfig Developer

    That's the way ISPConfig handles forwards. If you don't want this, you can specify your own rewrite rules in the Apache Directives field of that web site in ISPConfig.
    This link might help you: http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html
     
  3. laqup

    laqup New Member

    I can't believe this. Let's start again, maybe my first post was confusing, or I miss an important piece or chose a complete wrong approach.

    Let's imagine: We have a client who owns two domains, let's say google.com and amazon.com. This client wants only one user account (credentials). What I would do is the following:
    - Create a Client
    - Asign a website
    - Use www as hostname and google.com as domain

    First problem:
    - Now I can't specify a forward rule for www.google.com, I have to put my index-file in the DocumentRoot (web/)

    Next steps:
    - Create a new co-domain: amazon.com and www.amazon.com with a forward to the folder (web/)"amazon"

    Second problem:
    - If I type www.amazon.com in the browser I am externally redirected to www.google.com/amazon (absolute no-go)

    Okay, now I'll try to find a better solution:
    - I'll use the Apache Directives
    - I change the apache documentroot to /amazon

    Third problem:
    - Oh wait, this will change documentroot for google.com too because they use both the same virtualhost - not a good idea

    Next Apache Directives Approach:
    - Change the Rewrite condition
    - RewriteCond %{HTTP_HOST} ^amazon\.com [NC] RewriteRule ^/(.*)$ /amazon/$1
    - This works! BUT: The Apache directives are written ABOVE all other entries in the vhosts_ispconfig.conf
    - I have to delete the automated entries in the vhosts_ispconfig

    Fourth problem:
    - If I make a change in ISPConfig or manually restart the config server, the old Rewrite conditions will be added BELOW my custom apache directive, hence my own code gets overruled and won't work anymore

    So please tell me that I am stupid and have chosen a complete wrong approach to solve this problem, this would make me very happy.
    The other solution is: ISPConfig won't work for me, that would make me sad. :(

    Thanks in advance,
    Best regards,
    Daniel

    Update:
    Okay, I used the [L] flag in the rewrite conditions to prevent further rule execution. This solves the fourth problem.
    The first problem could be solved too, with a similar rewrite rule:
    RewriteCond %{HTTP_HOST} ^www\.google\.com [NC]
    RewriteRule ^/(.*)$ /google/$1 [L]

    Nevertheless I'd be glad if you could tell me if this is the right (or only) approach, or if I'm thinking to complex.
     
    Last edited: Nov 9, 2009

Share This Page