subdomains, does it has to work like that

Discussion in 'General' started by shrek, May 5, 2009.

  1. shrek

    shrek New Member

    example vhost conf

    Code:
    ######################################
    # Vhost: www.domain.tld:80
    ######################################
    #
    #
    <VirtualHost IP_ADDRESS:80>
    	ServerName www.domain.tld:80
    	ServerAdmin webmaster@domain.tld
    	DocumentRoot /var/www/web34/web
    	ServerAlias domain.tld forum.domain.tld www.forum.domain.tld www.domain.tld
    	DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.tld index.jsp Default.htm default.htm
    	Alias  /cgi-bin/ /var/www/web34/cgi-bin/
    	AddHandler cgi-script .cgi
    	AddHandler cgi-script .pl
    	ErrorLog /var/www/web34/log/error.log
    	AddType aptldication/x-httpd-php .php .php3 .php4 .php5
    	php_admin_flag safe_mode Off
    	AddType text/html .shtml
    	AddOutputFilter INCLUDES .shtml
    	Alias /error/ "/var/www/web34/web/error/"
    	ErrorDocument 400 /error/invalidSyntax.html
    	ErrorDocument 401 /error/authorizationRequired.html
    	ErrorDocument 403 /error/forbidden.html
    	ErrorDocument 404 /error/fileNotFound.html
    	ErrorDocument 405 /error/methodNotAllowed.html
    	ErrorDocument 500 /error/internalServerError.html
    	ErrorDocument 503 /error/overloaded.html
    	AliasMatch ^/~([^/]+)(/(.*))? /var/www/web34/user/$1/web/$3
    	AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web34/user/$1/web/$3
    	RewriteEngine on
    	RewriteCond %{HTTP_HOST}   ^forum\.domain\.tld [NC]
    	RewriteRule   ^/(.*)$  http://www.domain.tld/forum$1  [R]
    	RewriteCond %{HTTP_HOST}   ^www\.forum\.domain\.tld [NC]
    	RewriteRule   ^/(.*)$  http://www.domain.tld/forum$1  [R]
    	<IfModule mod_rewrite.c>
    	  RewriteEngine on
    	  RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    	  RewriteRule .* - [F]
    	</IfModule>
    </VirtualHost>
    #
    #
    #
    ######################################
    and now. entering address forum.domain.tld i'm redirected to the domain.tld/forum . I'm moving my two virtual hostings into vps with isp2 and it drives me mad. I'm used to that when i create a subdomain the subdomain stays in address bar. Is it connected with this rewrite cond? Is it possible to change isp2 files to make as I soopose other vhosts with subdomains?
    I dont need "other way to get into subfolder", and creating completely new sites isn't that what i wish to have...
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. shrek

    shrek New Member

    thanks for response ;]

    i think that the thing which i wanted to have are multiple Document roots in domain. For example

    I create new Site, space i 1000MB, Traffic 60GB/y

    and i connect to this portal domain www.domain.tld. That portal has forum located at www.domain.tld/forum BUT I want the forum to bo placed under www.forum.domain.tld. Actually attaching such co-domain, and redirecting it, the browswer redirects me into www.domain.tld/forum. So when I'll print a $_SERVER['HTTP_HOST'] i'll get domain.tld not forum.domain.tld.

    Does this is managed by rewrite rules too ? If yes where are the base patterns - php files- in isp2 with wchich i can change those things?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats what I posted you above.
     

Share This Page