Learn WordPress From The Ground Up: Taking Care of Your Site Files

After you install WordPress there are two files that get created on the server.

The .htaccess file and the wp-config.php file.

Each of these files hold lines of code that tell the server and the WordPress files what to do when people come to visit your website.

.htaccess

This file controls the permalinks on your site.

Permalinks are the “permanent links” to your pages and posts.

Like if you made an About page on your site, then the permalink could be “mysite.com/about” and a Contact page could be “mysite.com/contact-us”.

If you open the file with a text editor this is what it looks like..

You shouldn’t have to mess with this file, but if it’s ever missing or got hacked then you would know something is wrong if you try to visit a page on your site and get redirected to some other site or get a 404 error screen like this..

If you ever need a fresh copy of the .htaccess file you can find it here.

wp-config.php

This file keeps track of the connection to your database.

It’s also where you might put lines of code to enable different features in WordPress that aren’t normally available to the average user, like debug mode and the top secret “multisite network” feature.

WordPress comes with a sample config file that looks like this..

If the database settings aren’t right you’ll get a message on your website like this..

All of the WordPress files, including these two, can be replaced with new copies if they ever get messed up by hackers or amateurs.

What’s harder to replace are the files inside your “wp-content” folder.