A
aviddv1
Guest
Hey there,
I've got Plesk 8 and I spent hours looking around for an answer as to how I can redirect a subdomin to a directory in the domain.
Seems I found a solution so I figured I'd post it just in case anyone else is looking for an answer.
First thing I did was edit the httpd.include file in the main domain's conf directory. Under the virtual host tag for the subdomain for port 80, I added this line right before the close tag:
include /var/www/vhosts/(domain)/subdomains/(subdomain)/conf/vhost.conf
Then in the subdomain's conf directory I created a file called vhost.conf.
Inside the vhost.conf file I added the following:
DocumentRoot /var/www/vhosts/(domain)/httpdocs/(destination folder)
<Directory /var/www/vhosts/(domain)/httpdocs>
<IfModule sapi_apache2.c>
php_admin_value open_basedir "/var/www/vhosts/(domain)/httpdocs/(destination folder):/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/var/www/vhosts/(domain)/httpdocs/(destination folder):/tmp"
</IfModule>
</Directory>
The vhost.conf file tells apache that the root of the subdomain is the destination folder and then assigns the php base directory as the destination folder.
Don't forget to:
/usr/local/psa/admin/bin/websrvmng -u --vhost-name=(domain)
and restart apache:
/sbin/service httpd restart
Hope this helps.
Thanks,
Ward
I've got Plesk 8 and I spent hours looking around for an answer as to how I can redirect a subdomin to a directory in the domain.
Seems I found a solution so I figured I'd post it just in case anyone else is looking for an answer.
First thing I did was edit the httpd.include file in the main domain's conf directory. Under the virtual host tag for the subdomain for port 80, I added this line right before the close tag:
include /var/www/vhosts/(domain)/subdomains/(subdomain)/conf/vhost.conf
Then in the subdomain's conf directory I created a file called vhost.conf.
Inside the vhost.conf file I added the following:
DocumentRoot /var/www/vhosts/(domain)/httpdocs/(destination folder)
<Directory /var/www/vhosts/(domain)/httpdocs>
<IfModule sapi_apache2.c>
php_admin_value open_basedir "/var/www/vhosts/(domain)/httpdocs/(destination folder):/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/var/www/vhosts/(domain)/httpdocs/(destination folder):/tmp"
</IfModule>
</Directory>
The vhost.conf file tells apache that the root of the subdomain is the destination folder and then assigns the php base directory as the destination folder.
Don't forget to:
/usr/local/psa/admin/bin/websrvmng -u --vhost-name=(domain)
and restart apache:
/sbin/service httpd restart
Hope this helps.
Thanks,
Ward