• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

Link directories across domains

J

JoaoCorreia

Guest
Hello,

Any ideas how can I link directories across domains inside httpdocs ?

I have two domains with same content except index.php so I wanted to link several directories across these domains.

Im getting PHP Warning: main(): open_basedir restriction in effect.!


Best regards
Joao Correia
 
You may configure the open_basedir restriction...

Create a vhost.conf file in /var/www/vhosts/yourdomain.com/conf with something like that:
PHP:
<Directory /var/www/vhosts/$domain/httpdocs> 

<IfModule sapi_apache2.c> 
php_admin_flag engine on 
php_admin_flag safe_mode off 
php_admin_value open_basedir 
"/var/www/vhosts/$domain/httpdocs:/var/www/vhosts/$domain/web_users/$user:/var/www/vhosts/$domain/subdomains/$subdomain/httpdocs:/tmp" 
</IfModule> 
<IfModule mod_php5.c> 
php_admin_flag engine on 
php_admin_flag safe_mode off php_admin_value open_basedir 
"/var/www/vhosts/$domain/httpdocs:/var/www/vhosts/$domain/web_users/$user:/var/www/vhosts/$domain/subdomains/$subdomain/httpdocs:/tmp" 
</IfModule> 
</Directory>

This exemple shows how to allow a domain ($domain) to access files in a subdomain-level dir ($subdomain) and a userdir ($user). You just have to modify the path to meet your needs.

Once it has been done, don't forget to reload the conf files via:
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=$domain

Hope this helps!
 
Back
Top