Htaccess is short for Hypertext Access. It is a configuration file used by Apache-based web servers.
Configuration files configure the initial settings of a program or, in this case, the server. This means that the .htaccess file can be used to make the server behave in a certain way. Each function is just a line of text, or code, which tells the server what to do. You can add or change functionality by adding or changing the code in the .htaccess file.
What can I use .htaccess for?
There are a lot of possibilities with .htaccess, you can, for example, use it to:
- Protect your site with a password.
- Create a custom-made error page.
- Redirect visitors to another page.
Htaccess is a very powerful tool. To avoid that you could break your site by accident, we have disabled certain functions. Do you want to know if you can use a certain function on your one.com webspace? Please contact our support for more information.
The format of .htaccess
The .htaccess file is a bit special because it begins with a dot. This means that in some FTP programs, it is hidden, and you generally cannot edit it on your computer without renaming it to, for example, htaccess.txt. We recommend using our built-in File Manager to manage your .htaccess files.
Create a new .htaccess file
First, you need to create a .htaccess file. If one already exists on your web space, you can edit that one.
- Log in to your Control Panel on one.com and open File Manager.
- Click Create, choose File and then Other.
- Name the file .htaccess and press Enter on your keyboard.
- Select the .htaccess file and click Edit.
You can now add different lines of code to the file, depending on what functionality you want. We have created guides for the most commonly used functions, check out the links below.
- How can I change the default charset?
- How can I change the default start page?
- How can I add a custom-made error page?
- How can I protect my website with a password?
- How can I redirect a visitor to another page?
- How can I disable the Varnish cache?