There is a site in /var/www/vhosts/domain.com/subdomain/system/httpdocs/site . He is a copy of what lies in /opt/site . In order not to synchronize them manually, I want to redirect the system.domain / site to /opt/site . Made symlink:

 ln -s /opt/site site2 

But when I access system.domain.com/site2 in the browser, I see a clean white sheet. If I do symlink on a folder,

 ln -s /var/www/vhosts/domain.com/subdomain/system/httpdocs/site_copy symlink 

then when accessing the system.domain.com/symlink page is loaded, which makes it clear that symlink'i work. And the case is most likely in the rights.

I tried to add in /var/www/vhosts/domain.com/subdomain/system/httpdocs/site/.htaccess

 <Directory /opt/site> Order allow,deny Allow from all </Directory> 

Also - a white sheet.

/var/www/vhosts/domain.com/subdomain/system/httpdocs/site/.htaccess:

 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /site/ Options +FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L] #RewriteRule . index.php </IfModule> Options FollowSymLinks -- я добавил 
  • You need the Options directive, by default it blocks symlinks - etki

1 answer 1

You need the options directive, which can be found in: server config , virtual host , directory , .htaccess .

in particular, the following option should be specified:

 options followsymlinks 
  • If I go over the symlink to the directory /var/www/vhosts/domain.com/subdomain/system/httpdocs/site_copy, does this mean that this option is inherited from the configs above? - Mihail Politaev
  • Yes, obviously somewhere in the configuration redefined standard behavior: do not follow symlinks. - aleksandr barakin
  • Why then does he follow the symlink if he links to /var/www/vhosts/domain.com/subdomain/system/httpdocs/site_copy? - Mihail Politaev
  • “I’m switching to”, “it follows” - are you talking about the client’s browser in which requests are made to your site? - aleksandr barakin
  • Yes, of course about the browser. Simlink when it leads to one place then works, when not to another. In the question added the contents of .htaccess. The folksimlink option is added. - Mihail Politaev