{"id":3942,"date":"2009-09-08T14:33:55","date_gmt":"2009-09-08T21:33:55","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=3942"},"modified":"2009-09-08T14:33:55","modified_gmt":"2009-09-08T21:33:55","slug":"different-directory-index-page","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/snippets\/htaccess\/different-directory-index-page\/","title":{"rendered":"Different Directory Index Page"},"content":{"rendered":"

Normally index.html or index.php is the default page a server serves up when visiting a directory without specifying a file name. You can change this with .htaccess:<\/p>\n

DirectoryIndex index2.html<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

Normally index.html or index.php is the default page a server serves up when visiting a directory without specifying a file name. You can change this with .htaccess: DirectoryIndex index2.html<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":3826,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"page-snippet.php","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":""},"tags":[],"acf":[],"jetpack-related-posts":[{"id":4482,"url":"https:\/\/css-tricks.com\/snippets\/php\/display-styled-directory-contents\/","url_meta":{"origin":3942,"position":0},"title":"Display Styled Directory Contents","date":"October 22, 2009","format":false,"excerpt":"Servers can be configured to show the contents of a directory that doesn't have an index file to render. The result is usually less than visually spectacular: Lackluster default in Chrome More better, View Demo We can take control of this ourselves by replicating this functionality with PHP. Make an\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2009\/10\/betterized.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":4232,"url":"https:\/\/css-tricks.com\/snippets\/htaccess\/password-protect-folders\/","url_meta":{"origin":3942,"position":1},"title":"Password Protect Folder(s)","date":"September 25, 2009","format":false,"excerpt":"Put in .htaccess file in the directory you are trying to protect: AuthType Basic AuthName \"This Area is Password Protected\" AuthUserFile \/full\/path\/to\/.htpasswd Require valid-user Ideally, the .htpasswd file will be not in a public facing directory. Put this in there: chriscoyier:$apr1$O\/BJv...$vIHV9Q7ySPkw6Mv6Kd\/ZE\/ That is just a sample, you can create the\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":207270,"url":"https:\/\/css-tricks.com\/snippets\/html\/start-a-web-server-with-one-terminal-command-on-os-x\/","url_meta":{"origin":3942,"position":2},"title":"Start a Web Server With One Terminal Command on OS X","date":"August 27, 2015","format":false,"excerpt":"I've searched for this three times this week, so I figured I'd better make sure I have a copy of it. Python 2: python -m SimpleHTTPServer 8000 Navigate to the project directory in the terminal and do that command. Then http:\/\/localhost:8000 will server up that directory (as in, it's `index.html`\u2026","rel":"","context":"In \"php\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4922,"url":"https:\/\/css-tricks.com\/snippets\/php\/increase-maximum-php-upload-size\/","url_meta":{"origin":3942,"position":3},"title":"Increase Maximum PHP Upload Size","date":"December 3, 2009","format":false,"excerpt":"Many shared hosts put very low restrictions on the size of the files that can be uploaded through PHP. But, many hosts also allow you to create your own php.ini file in the root directory of your site. This file can override some of the servers default PHP settings. If\u2026","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9851,"url":"https:\/\/css-tricks.com\/snippets\/wordpress\/display-image-next-to-each-tag\/","url_meta":{"origin":3942,"position":4},"title":"Display Image Next To Each Tag","date":"June 19, 2011","format":false,"excerpt":"This code belongs inside the loop. It will look in a specific directory for any images that match the slugs of article tags, display them and link them to the relevant tag archive.","rel":"","context":"With 8 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2883,"url":"https:\/\/css-tricks.com\/video-screencasts\/64-building-a-photo-gallery\/","url_meta":{"origin":3942,"position":5},"title":"#64: Building a Photo Gallery","date":"June 9, 2009","format":false,"excerpt":"This photo gallery will automatically build itself from a directory of images, including sub-directories and the images inside them. Images open in a nice looking jQuery lightbox. Links from Video: Demo ImgBrowz0r prettyPhoto jQuery plugin","rel":"","context":"In "Article"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/3942"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=3942"}],"version-history":[{"count":1,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/3942\/revisions"}],"predecessor-version":[{"id":3943,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/3942\/revisions\/3943"}],"up":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/3826"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=3942"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=3942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}