{"id":906,"date":"2021-07-23T12:40:57","date_gmt":"2021-07-23T12:40:57","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/directoryindex-priority\/"},"modified":"2021-07-23T12:40:57","modified_gmt":"2021-07-23T12:40:57","slug":"directoryindex-priority","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/directoryindex-priority\/","title":{"rendered":"DirectoryIndex Priority"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\">\n<div id=\"versioned-article-header\">\n<p class=\"valid-version-info\"><em>Valid for versions 82 through the latest version<\/em><\/p>\n<\/div>\n<div id=\"version-select-group\" aria-label=\"select versions\">\n<h4>Version:<\/h4>\n<h4>82<\/h4>\n<\/div><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>Visitors see the index page by default when they access a directory (for example, <code>index.html<\/code>). The <em>DirectoryIndex Priority<\/em> interface allows you to specify the filenames that Apache recognizes and displays as index pages. You can also set the priority in which Apache selects an index page if more than one of these filenames appears in a directory.<\/p>\n<p>To perform these actions, the system modifies the <code>\/usr\/local\/apache\/conf\/httpd.conf<\/code> file. For example, if you configure the system to display the <code>index.php<\/code> file, the system adds the following line:<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">DirectoryIndex index.php<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<h2 id=\"add-a-new-filename\">Add a new filename<\/h2>\n<p>To add a new filename to the list of index pages that Apache recognizes, perform the following steps:<\/p>\n<ol>\n<li>Click <em>Add<\/em>.<\/li>\n<li>Enter the name of the index file that you wish to add (for example, <code>index.nick<\/code>).<\/li>\n<li>Click <em>OK<\/em>.<\/li>\n<li>Click <em>Save<\/em>.<\/li>\n<li>Click <em>Rebuild Configuration and Restart Apache to configure Apache<\/em> to use the new DirectoryIndex settings.\n<ul>\n<li>To restart Apache later, use WHM\u2019s <em>HTTP Server (Apache)<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Restart Services &gt;&gt; HTTP Server (Apache)<\/em>) or run the <code>\/scripts\/restartsrv_httpd<\/code> command via SSH as the <code>root<\/code> user.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2 id=\"remove-a-filename\">Remove a filename<\/h2>\n<p>To remove filenames from the list of index pages that Apache recognizes, perform the following steps:<\/p>\n<ol>\n<li>In the available menu, select the index file or files that you wish to remove.<\/li>\n<li>Click <em>Remove<\/em>.<\/li>\n<li>Click <em>Save<\/em>.<\/li>\n<li>Click <em>Rebuild Configuration and Restart Apache<\/em> to configure Apache to use the new DirectoryIndex settings.\n<ul>\n<li>To restart Apache later, use WHM\u2019s <em>HTTP Server (Apache)<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Restart Services &gt;&gt; HTTP Server (Apache)<\/em>) or run the <code>\/scripts\/restartsrv_httpd<\/code> command via SSH as the <code>root<\/code> user.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2 id=\"set-index-page-name-priority\">Set index page name priority<\/h2>\n<p>Filenames that the interface displays higher in the menu have a higher priority than names that are lower in the menu.<\/p>\n<p>To reorder the priority of index page names that Apache recognizes, perform the following steps:<\/p>\n<ol>\n<li>In the available menu, select the index file that you wish to move up or down in priority.<\/li>\n<li>Click <em>Move Up<\/em> or <em>Move Down<\/em> to change the filename\u2019s order.\n<ul>\n<li>For example, if you want <code>index.html<\/code> to appear instead of <code>index.php<\/code>, select <code>index.html<\/code> from the menu and click <em>Move Up<\/em> until <code>index.html<\/code> is higher in the menu than the <code>index.php<\/code> entry.<\/li>\n<\/ul>\n<\/li>\n<li>Click <em>Save<\/em>.<\/li>\n<li>Click <em>Rebuild Configuration and Restart Apache<\/em> to configure Apache to use the new DirectoryIndex settings.\n<ul>\n<li>To restart Apache later, use WHM\u2019s <em>HTTP Server (Apache)<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Restart Services &gt;&gt; HTTP Server (Apache)<\/em>) or run the <code>\/scripts\/restartsrv_httpd<\/code> command via SSH as the <code>root<\/code> user.<\/li>\n<\/ul>\n<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Valid for versions 82 through the latest version Version: 82 Overview Visitors see the index page by default when they access a directory (for example, index.html). The DirectoryIndex Priority interface allows you to specify the filenames that Apache recognizes and displays as index pages. You can also set the priority in which Apache selects an &hellip;<\/p>\n","protected":false},"author":1,"featured_media":907,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/906"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=906"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/906\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/907"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}