Content:Virtual versus File Include
Jump to navigation
Jump to search
Both include virtual
and include file
are examples of server side includes (SSIs). When the webserver is serving a page to a client, and it sees an include, it takes the code from the included file and "pastes" it into the file that it's serving. The only difference between the two is how you specify the path to the file.
They look something like this:
<!-- #include virtual="/includes/header.html" --> or <!-- #include file="../../includes/header.html" -->
Include Virtual
When including a virtual, specify it from the webroot, that is, the "virtual filesystem" that the website resides on. Because of this, it is impossible to access files outside of the web document tree.
Include File
When including a file, specify the path from the directory where the parent page resides.