Setting Default Index Page Using .htaccess File

Sometimes you may want to have a different page be the default index page for your site. This is particularly helpful when setting up a WordPress install that you want to work on, but aren’t ready to bring live to your site visitors. Simply go into your .htaccss file and add the follow line of code:

DirectoryIndex index.html index.php

Now, upload an index.html file to your server and everyone who visits your base URL will be served the HTML page. If you want to see your WP install, simple append /index.php to then end of your base URL. Once you’re ready to bring your WP site live, just delete the html file and your visitors will be served the php file instead.


Leave a Reply