1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Vhost.conf document root issues

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by crsbuilds, Feb 3, 2010.

  1. crsbuilds

    crsbuilds Guest

    0
     
    Ok I am trying to set my document root to a subdirectory using the vhost.conf file like mentioned in older threads, but to no avail. I get an error telling me I can not put document root there? I was successful at using a redirect instead, but this makes it so the sub directory is visible in the url. Which I did not want.

    This is what I placed in vhost.conf file:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteMap lowercase int:tolower

    # First make sure we add www. if it wasn't specified
    RewriteCond %{HTTP_HOST} !^www.webdesignerchris.com$
    RewriteCond %{HTTP_HOST} ^webdesignerchris.com$
    RewriteRule ^/(.*) http://www.webdesignerchris.com/$2 [R=301,L]

    # Now redirect the domain's docroot to a specific folder /CMS
    RewriteCond %{REQUEST_URI} ^/
    RewriteCond %{REQUEST_URI} !/crsbuilds
    RewriteRule (.*) http://www.webdesignerchris.com/crsbuilds [R,L]
    </IfModule>

    #DocumentRoot /var/www/vhosts/webdesignerchris.com/httpdocs/crsbuilds

    I am using centos 5 & plesk 9.3 The commented line above is what I tried first, but gave me the error. I think because the doc root was already declared back at the httpd.include file toward the top and the include for vhost.conf is at the bottom?

    Anyway Probably a newbie question but hey thats what I am =)

    Thanks in advance
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    Did you

    PRODUCT_ROOT_D/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<domain_name>

    after your customization?
     
  3. crsbuilds

    crsbuilds Guest

    0
     
    Yeah that works great! Thank you you so much. I was pulling my hair out on that. Guess I wont ever forget to do that next time.

    You the man IgorG
     
Loading...