Quantcast

How to add html page on root of WordPress

wordpress html file

Ever wondered if you needed a separate html page on root of your WordPress installation? And it becomes difficult to handle WordPress because it takes you to your root domain if you click on Home link or the logo of your site.

Actually this is easy to set up and has two ways to achieve this.

Option 1 – Define a default document

The above code will go in your .htaccess file which is located on root of your domain.

The sequence tells Apache to follow which file first, and the rest accordingly. So I set index.html first and it will always be served when the root domain is accessed in the browser. Your WordPress file can remain index.php as it won’t be picked up when accessing the root domain.

Option 2 – Rewrite index file for WordPress

So for any reason if you cannot have the option 1 work for you, you can use a rewrite method in .htaccess file. Before doing that, you have to rename your WordPress’ index.php file to something else. To show an example, I use index_wp.php. Follow the sample code below.

The above code is pretty easy and self explanatory. We are telling WordPress to use index_wp.php as its default root file for all purposes. WordPress will be using index_wp.php for loading its own pages with all the functions.

I hope the above quick tutorial is useful for you. Please feel free to leave your feedback or improvements in the comments section below.

Looking for a quality hosting service? here are a few I suggest.
BlueHost | HostGator | Media Temple
Admin
Admin
Ali has been an entrepreneur in web, video and related technologies. Having worked with many business across the globe, Ali stands truly a great pillar in the business working with him.