Let's say you have the main domain "abc.com" (the real path is "/", since all files fall under " public_html " or " httpdocs "). Now you will need to create one directory (say, "common_includes") in this main domain, inside which you can store all the usual included files (for example, header and footer files).
Say your header and footer files will be "header.php" and "footer.php". Thus, these files will be available as "/common_includes/header.php" and "/common_includes/footer.php" in any function that includes PHP that requires mention of Real Paths.
Now, if you use the above two real paths in the "include_once ()" method in any of your subdomains, you will be able to include these files (header and footer files) in relation to the subdomain you are using. This is how it works normally.
Hope this helps.
source share