{"id":814,"date":"2024-06-30T08:46:55","date_gmt":"2024-06-30T08:46:55","guid":{"rendered":"https:\/\/www.cmsgalaxy.com\/blog\/?p=814"},"modified":"2024-06-30T09:55:51","modified_gmt":"2024-06-30T09:55:51","slug":"drupal-guide-directory-structure-of-drupal","status":"publish","type":"post","link":"https:\/\/www.cmsgalaxy.com\/blog\/drupal-guide-directory-structure-of-drupal\/","title":{"rendered":"Drupal Guide: Directory Structure of Drupal"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"587\" src=\"https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/06\/image-1024x587.png\" alt=\"\" class=\"wp-image-815\" srcset=\"https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/06\/image-1024x587.png 1024w, https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/06\/image-300x172.png 300w, https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/06\/image-768x440.png 768w, https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2024\/06\/image.png 1070w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Directory Structure of Drupal 7<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>drupal7\/\r\n\u251c\u2500\u2500 includes\/\r\n\u251c\u2500\u2500 misc\/\r\n\u251c\u2500\u2500 modules\/\r\n\u251c\u2500\u2500 profiles\/\r\n\u251c\u2500\u2500 scripts\/\r\n\u251c\u2500\u2500 sites\/\r\n\u2502   \u251c\u2500\u2500 all\/\r\n\u2502   \u2502   \u251c\u2500\u2500 libraries\/\r\n\u2502   \u2502   \u251c\u2500\u2500 modules\/\r\n\u2502   \u2502   \u2514\u2500\u2500 themes\/\r\n\u2502   \u251c\u2500\u2500 default\/\r\n\u2502   \u2502   \u251c\u2500\u2500 files\/\r\n\u2502   \u2502   \u251c\u2500\u2500 settings.php\r\n\u2502   \u2502   \u2514\u2500\u2500 default.settings.php\r\n\u2502   \u2514\u2500\u2500 example.sites.php\r\n\u251c\u2500\u2500 themes\/\r\n\u251c\u2500\u2500 updates\/\r\n\u251c\u2500\u2500 web.config\r\n\u251c\u2500\u2500 .htaccess\r\n\u251c\u2500\u2500 cron.php\r\n\u251c\u2500\u2500 index.php\r\n\u251c\u2500\u2500 install.php\r\n\u251c\u2500\u2500 LICENSE.txt\r\n\u251c\u2500\u2500 MAINTAINERS.txt\r\n\u251c\u2500\u2500 README.txt\r\n\u2514\u2500\u2500 xmlrpc.php\r\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation of Installed Files and Directories<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Root Directory<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>index.php:<\/strong> The main entry point for the website. All requests are directed here, and it routes them to the appropriate handler within Drupal.<\/li>\n\n\n\n<li><strong>install.php:<\/strong> The script that runs the installation process for Drupal.<\/li>\n\n\n\n<li><strong>cron.php:<\/strong> A script to handle periodic tasks, such as clearing caches and running scheduled tasks.<\/li>\n\n\n\n<li><strong>.htaccess:<\/strong> A configuration file for Apache web server settings, such as URL rewriting and access restrictions.<\/li>\n\n\n\n<li><strong>web.config:<\/strong> A configuration file for IIS (Internet Information Services) web server settings.<\/li>\n\n\n\n<li><strong>LICENSE.txt:<\/strong> The GNU General Public License under which Drupal is distributed.<\/li>\n\n\n\n<li><strong>MAINTAINERS.txt:<\/strong> A list of people who maintain the Drupal codebase.<\/li>\n\n\n\n<li><strong>README.txt:<\/strong> Basic information about the Drupal installation.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Core Directories<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>includes\/:<\/strong> Contains essential core files and libraries used by Drupal, including bootstrap files and common functions.<\/li>\n\n\n\n<li><strong>misc\/:<\/strong> Contains miscellaneous files such as JavaScript, CSS, and images used by the core system.<\/li>\n\n\n\n<li><strong>modules\/:<\/strong> Contains core modules that provide various features and functionalities out of the box. Contributed and custom modules should not be placed here.<\/li>\n\n\n\n<li><strong>profiles\/:<\/strong> Contains installation profiles, which are sets of modules and configurations for specific types of Drupal sites.<\/li>\n\n\n\n<li><strong>scripts\/:<\/strong> Contains scripts for use in managing and maintaining a Drupal site.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Sites Directory<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>sites\/<\/code> directory is where all site-specific files and configurations are stored.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>all\/:<\/strong> This directory is for modules, themes, and libraries that are shared across all sites in a multisite setup.\n<ul class=\"wp-block-list\">\n<li><strong>libraries\/:<\/strong> Contains third-party libraries used by modules or themes.<\/li>\n\n\n\n<li><strong>modules\/:<\/strong> Contains contributed and custom modules. This is where you should place any additional modules you download or create.<\/li>\n\n\n\n<li><strong>themes\/:<\/strong> Contains contributed and custom themes. This is where you should place any additional themes you download or create.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>default\/:<\/strong> This directory is used for the default site configuration. In a single-site setup, this is where you store site-specific files and configurations.\n<ul class=\"wp-block-list\">\n<li><strong>files\/:<\/strong> Stores uploaded files, such as images and documents.<\/li>\n\n\n\n<li><strong>settings.php:<\/strong> The main configuration file for the site, including database connection details.<\/li>\n\n\n\n<li><strong>default.settings.php:<\/strong> A template for the <code>settings.php<\/code> file.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>example.sites.php:<\/strong> An example file showing how to set up multisite configurations.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Themes Directory<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>themes\/:<\/strong> Contains core themes that provide the visual appearance for the site. Contributed and custom themes should not be placed here; instead, they should be placed in <code>sites\/all\/themes<\/code>.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Updates Directory<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>updates\/:<\/strong> Contains scripts for updating the Drupal core and contributed modules.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Common Customization and Development Locations<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>sites\/all\/modules\/:<\/strong> Place contributed and custom modules here.<\/li>\n\n\n\n<li><strong>sites\/all\/themes\/:<\/strong> Place contributed and custom themes here.<\/li>\n\n\n\n<li><strong>sites\/default\/files\/:<\/strong> Store uploaded files here.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Directory Structure of Drupal 7 Explanation of Installed Files and Directories Root Directory Core Directories Sites Directory The sites\/ directory is where all site-specific files and configurations&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[790],"tags":[],"class_list":["post-814","post","type-post","status-publish","format-standard","hentry","category-drupal"],"_links":{"self":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/comments?post=814"}],"version-history":[{"count":1,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/814\/revisions"}],"predecessor-version":[{"id":816,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/814\/revisions\/816"}],"wp:attachment":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/media?parent=814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/categories?post=814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/tags?post=814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}