Default Page Properties

The default-doc node is used to enable or disable displaying the default page when the user visits the virtual directory with no particular file name specified. This node is defined by data type VDirDefaultDocType (virtdir.xsd). It is structured as follows:

  • The enabled node is required. If set to true, enables the display of the default page when the user visits the virtual directory. Data type: boolean.
  • The search node is optional. Specifies the list of default HTML pages in the order they are searched in the virtual directory. The first match is displayed. Data type: string.
  • The disabled node is required. If set to true, disables the display of the default page for the virtual directory. In combination with the dir_browsing node set to true, forces the display of all nested files and directories in FTP style. If dir_browsing is false, the "Access forbidden" message is displayed.

 

The following sample packet creates a virtual directory, enables the display of the default page for it, and specifies the list of HTML files that can serve as default pages if found in the virtual directory:

<packet>
<virtdir>
<create>
   <site-id>1</site-id>
   <name>/my_vdir</name>
   <properties> 
      <default-doc>
          <enabled/>
          <search>index.html</search>
          <search>main.html</search>
          <search>default.html</search>
      </default-doc>
   </properties> 
</create>
</virtdir>
</packet>

The following packet disables the display of a default page but enables the display of all files located in the virtual directory in the FTP style:

<packet>
<virtdir>
<create>
   <site-id>1</site-id>
   <name>/my_vdir</name>
   <properties> 
      <dir-browsing>true</dir-browsing>
      <default-doc>
          <disabled/>
      </default-doc>
   </properties> 
</create>
</virtdir>
</packet>

 

The following packet creates a virtual directory and disables access to it via the browser:

<packet>
<virtdir>
<create>
   <site-id>1</site-id>
   <name>/my_vdir</name>
   <properties> 
      <dir-browsing>false</dir-browsing>
      <default-doc>
          <disabled/>
      </default-doc>
   </properties> 
</create>
</virtdir>
</packet>
 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.