.htaccess Files
An .htaccess file is a powerful tool to help you get the most our of your hosting services. This tool can be used modify the default behaviors of your web server, to an extent. While it has several uses that power users will be able to use, it can also be used to redirect web site traffic, either to different directories, or even to completely different servers.
Let us take a look at .htaccess files and how they can be used with your Deluxe Hosting web hosting services.
What is an .htaccess file
An .htaccess file is a hidden file (any file beginning with a period is hidden by default in UNIX systems) that can be used to modify the default behavior of a web hosting server.
With a shared hosting service, your account is on a server that is also used by several other users. Sharing the server resources helps reduce the cost of hosting by spreading the hardware costs across several accounts, as most websites require relatively little server resources. The down side of shared hosting is that the server must be configured in a way that works for most users, with some more advanced features disabled by default. It is also not feasible to configure each account on the server level.
Luckily, you can tweak your web hosting service using an .htaccess file. While this file is not able to override all server functions, it can be used to customize your environment. You can also use it to configure individual folders.
What can I do with an .htaccess file
While there is too much to mention it all here, the most common use of .htaccess files is for redirecting website traffic.
Whether you are looking to redirect to a different folder then the document root folder (if your website is in a subfolder), or perhaps your home page is named something other then the default index.html file, you can set these with an .htaccess file.
And not just for redirects. If you are using a CMS (Content Management System) to manage your website, such as WordPress or Joomla, they will also include an .htaccess file during installation. In this case, the .htaccess file is used to set up the environment that the CMS needs to function correctly.

Another common use of .htaccess files is to force web traffic to use the HTTPS protocol instead of the unencrypted HTTP. This is common with websites that are protected with SSL certificates. An SSL protected site will encrypt any data transferred between the server and the end user to prevent any third parties from being able to intercept the data for their own diabolical use. This is quickly becoming the standard for web sites. Find out more on SSL certificates here.
The .htaccess file can be a powerful tool in the right hands. If you would like to learn more about the features of the .htaccess file, check out this link to the Apache website.
How do I use an .htaccess file
An .htaccess file is a simple text based file. This means that you can edit it with any text based editor:
- any text editor on you computer, such as Notepad (WordPad or Word are not recommended as they include much more processing than needed)
- the text editor included with cPanel will work great
- most FTP clients include a text editor, these should function fine
- if you are using SSH, you can use your preferred text editor, such as nano or vi
The main thing to look for is a basic text editor that does not do a lot of auto correction or formatting. You want an app that will save exactly what you enter without altering it in any way.
If you do not have an .htaccess file in your directory, it either does not exist or is hidden. Remember, any files that begin with a period (dotfiles) are hidden by default. Depending on what editor you are using, you should be able to enable the viewing of hidden files.
In the cPanel File Manager, you can show hidden files by clicking on Settings in the upper right-hand side of the screen.

In the Settings menu, make sure that Show Hidden Files (dotfiles) checked. If you still do not see the file, you can create a new one.
Once you create or open your .htaccess file, you will see that it is just written in plain text. Here is an example of a WordPress htaccess file:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
While we cannot go over everything you can do with the .htaccess file, we can go over some of its most common uses.
Common .htaccess usage
Here are a few common reasons to add an .htaccess file to your document root folder.
Any line that begins with “#” is considered a comment and is not executed by the server. This is mostly used to describe what the code doing and for organization.
If you are still having issues, and need further support, please reach out to our support team using any of these methods.
Recent Articles
What is Cloud Hosting
You probably have heard a lot of buzz around the internet about "the cloud". But what is the cloud that everyone is so excited about, and what does it have to do with your [...]
Website Builder Contact Forms
A Contact Form can be a powerful online tool to help build your business client base and add new customers.
Website Builder Site Settings
Use the Site Settings section of your Website Builder service to customize your new website.
Create your new website with Website Builder
Create your new website for your new business using our new Deluxe Hosting Website Builder service