keeping subdomain URL in browser address bar

Discussion in 'Tips/Tricks/Mods' started by torusturtle, May 18, 2007.

  1. torusturtle

    torusturtle ISPConfig Developer ISPConfig Developer

    When creating a codomain (subdomain) and forward it to an internal folder the address bar of the browser changes displaying the forwarded folder.

    e.g. if you set the forward for sub.domain.tld to /sub/ you'll get domain.tld/sub/

    There are to ways to keep sub.domain.tld.

    1. Option
    Change the code of ISPConfig like described here:
    Co/sub-domains without rewritten URLs

    2. Option
    1. Leave the forward value empty
    2. Add the following into the Apache Directives field:
    RewriteEngine on
    RewriteCond %{HTTP_HOST}   ^sub.domain.tld [NC]
    RewriteRule   ^/(.*)$ /sub/$1  [L]
  2. madmucho

    madmucho ISPConfig Developer ISPConfig Developer

    Thanks for nice how-to is very usefull.

    when you want more rewrites for more subdomains simply do this rewrite

    RewriteEngine on
    RewriteCond %{HTTP_HOST}   ^sub1.domain.tld [NC]
    RewriteRule   ^/(.*)$ /sub1/$1  [L]
    RewriteCond %{HTTP_HOST}   ^sub2.domain.tld [NC]
    RewriteRule   ^/(.*)$ /sub2/$1  [L]
    Will be very happy when someone integrate this to co-domain and that is created automaticaly if user want (radiobutton or something similiar).
  3. sullast

    sullast New Member

    need help with this please

    where it says sub.domain.tld do you replace that with your info thats reference in the co-domain page and where the /sub/ is you replace with the file location trying to use it for webmail redirection of squirrelmail.pkg without the address changing, also i only have the one site and the one redirect i'm trying to do i can't get either way mentioned in the forums to work for redirect without changing address
  4. torusturtle

    torusturtle ISPConfig Developer ISPConfig Developer

    I guess you got it right.
    Problem could be that squirrelmail.pkg gets installed outside the domains folder and thus can't get redirected to.
  5. H2SO4

    H2SO4 New Member

    1. ok
    2. need a admin, reseller or customer can't.

    so i need to give admin access for all customer ? :confused:

    i agree with you.
    Last edited: Aug 2, 2007
  6. punto

    punto New Member

    that works well, thanks! ;)
  7. kanour

    kanour Member

    In ISPConfig

    You can write the directive in:

    Site > Basis > Apache Directives (Optional):
  8. H2SO4

    H2SO4 New Member

    you can write with admin access only.
  9. badran

    badran New Member

    When I add this:

    It acts as if there is a normal forward (using the ispconfig panel).

    If I add this:

    or this

    It gives me this result:
  10. torusturtle

    torusturtle ISPConfig Developer ISPConfig Developer

    The subdomain and the folder must have the same name:

    RewriteEngine on
    RewriteCond %{HTTP_HOST}   ^mortimer.domain.tld [NC]
    RewriteRule   ^/(.*)$ /mortimer/$1  [L]

Share This Page