Forum Moderators: phranque

Message Too Old, No Replies

how to set configuration for the subdomain

how to set virtual host for the subdomain in apache server

         

umamahe

5:15 am on May 4, 2009 (gmt 0)

10+ Year Member



Hi,

Can anyone give solution for this?

how to set virtual host for the subdomain
<VirtualHost *>
ServerName www.s.com
ServerAlias *.s.com
DocumentRoot /home/s/apache-tomcat-6.0.18/webapps/main
RewriteEngine on
RewriteLog /etc/httpd/logs/kkt.log
RewriteLogLevel 9
RewriteCond %{http_host} .
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteCond %{http_host} !^www.s.com [NC]
RewriteCond %{http_host} ^([^.]+)\.s.com [NC]
RewriteRule (/.*) [%1.s.com...]
RewriteCond %{REQUEST_METHOD} ^TRACE
</VirtualHost>

This is the code i have been using for the www.s.com going to the main folder while using demo.s.com going to the same main folder when i give demo.s.com/s going to the s folder

Can anyone give solution(idea) for this ,how to set the configuration for the subdomain process.

Thanks,
Umamahe

jdMorgan

2:26 pm on May 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The question is not clear. However, note that you first RewriteCond is redundant, and there appears to be an 'orphaned' RewriteCond at the end. Both should be deleted.

Jim