Hi,
I am looking to configure the VHOSTS like below example:
Eg:
example.com
ex1.example.com
ex2.example.com
I try to configure the above example in httpd-vhosts.conf file. After configure when I given example.com or ex1.example.com the page is redirecting to example.com only. It is not pointing to ex1.example.com.
How I can configure to point to different pages for different aliases. If I given example.com it should go to that directory path. If I given ex1.example.com it should go to ex1 directory path.
Please check the below configuratoin parameters and please help me where I am doing wrong. hosts file is already taken care.
NameVirtualHost *:80
<VirtualHost example.com:80 >
#=================================================
#== VIRTUAL CONTAINER 1 < ==
#=================================================
NameVirtualhost ServerAdmin admin@example.com
#DocumentRoot /ServerName ServerAlias *.ServerSignature Email
ServerPath "C:/example.com/htdocs/"
DocumentRoot "C:/example.com/htdocs/"
<Directory />
HostnameLookups On
Options Indexes FollowSymLinks MultiViews
IndexOptions FancyIndexing
DirectoryIndex /index.html index.php
AllowOverride None
Order deny,allow
Allow from all
Satisfy All
</Directory>
ErrorLog "C:/example.com/logs/[www.example.com] error.log"
TransferLog "C:/example.com/logs/[www.example.com] access.log"
</VirtualHost>
#================================================= =========
#== VIRTUAL CONTAINER 2 < ==
#================================================= =========
<VirtualHost ex1.example.com:80>
NameVirtualhost ServerName ServerSignature Email
ServerAdmin admin@example.com
ServerPath "C:/example.com/htdocs/us/ex1/"
DocumentRoot "C:/example.com/htdocs/us/ex1/"
<Directory />
HostnameLookups On
Options Indexes FollowSymLinks MultiViews
IndexOptions FancyIndexing
DirectoryIndex /index.html index.php
AllowOverride None
Order deny,allow
Allow from all
Satisfy All
</Directory>
ErrorLog "C:/example.com/logs/[www.ex1.example.com] error.log"
TransferLog "C:/example.com/logs/[www.ex1.example.com] access.log"
</VirtualHost>
Thanks in Advance...!
Thanks,
Srinivas
I am looking to configure the VHOSTS like below example:
Eg:
example.com
ex1.example.com
ex2.example.com
I try to configure the above example in httpd-vhosts.conf file. After configure when I given example.com or ex1.example.com the page is redirecting to example.com only. It is not pointing to ex1.example.com.
How I can configure to point to different pages for different aliases. If I given example.com it should go to that directory path. If I given ex1.example.com it should go to ex1 directory path.
Please check the below configuratoin parameters and please help me where I am doing wrong. hosts file is already taken care.
NameVirtualHost *:80
<VirtualHost example.com:80 >
#=================================================
#== VIRTUAL CONTAINER 1 < ==
#=================================================
NameVirtualhost ServerAdmin admin@example.com
#DocumentRoot /ServerName ServerAlias *.ServerSignature Email
ServerPath "C:/example.com/htdocs/"
DocumentRoot "C:/example.com/htdocs/"
<Directory />
HostnameLookups On
Options Indexes FollowSymLinks MultiViews
IndexOptions FancyIndexing
DirectoryIndex /index.html index.php
AllowOverride None
Order deny,allow
Allow from all
Satisfy All
</Directory>
ErrorLog "C:/example.com/logs/[www.example.com] error.log"
TransferLog "C:/example.com/logs/[www.example.com] access.log"
</VirtualHost>
#================================================= =========
#== VIRTUAL CONTAINER 2 < ==
#================================================= =========
<VirtualHost ex1.example.com:80>
NameVirtualhost ServerName ServerSignature Email
ServerAdmin admin@example.com
ServerPath "C:/example.com/htdocs/us/ex1/"
DocumentRoot "C:/example.com/htdocs/us/ex1/"
<Directory />
HostnameLookups On
Options Indexes FollowSymLinks MultiViews
IndexOptions FancyIndexing
DirectoryIndex /index.html index.php
AllowOverride None
Order deny,allow
Allow from all
Satisfy All
</Directory>
ErrorLog "C:/example.com/logs/[www.ex1.example.com] error.log"
TransferLog "C:/example.com/logs/[www.ex1.example.com] access.log"
</VirtualHost>
Thanks in Advance...!
Thanks,
Srinivas