Sunday, 11 August 2013

Main domain is redirecting to subdomain

Main domain is redirecting to subdomain

I've a domain domain.com and made one sub domain 'forum.domain.com'. I'm
using Apache2 and added one A record to the dns records and made
virtualNameServer as:
<VirtualHost *:80>
ServerName forum.domain.com
DocumentRoot /var/www/vanilla
<Directory /var/www/vanilla>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
allow from all
</Directory>
ErrorLog "|/usr/sbin/rotatelogs
/etc/httpd/logs/vanilla-error.%Y-%m-%d.log 86400"
CustomLog "|/usr/sbin/rotatelogs
/etc/httpd/logs/vanilla-access.%Y-%m-%d.log 86400" "%h %l %u %t %D
\"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
</VirtualHost>
In the sub-domain, I've installed Vanilla Forum Software. But, now the
problem is, whenever I go to http://domain.com or http://www.domain.com,
it goes to http://forum.domain.com. There is .htaccess by default in
forum.domain.com:
# Original
# If you modify this file then change the above line to: # Modified
<IfModule mod_rewrite.c>
RewriteEngine On
# Certain hosts may require the following line.
# If vanilla is in a subfolder then you need to specify it after the /.
# (ex. You put Vanilla in /forum so change the next line to:
RewriteBase /forum)
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]
</IfModule>
Please help. Thanks in advance.

No comments:

Post a Comment