Htaccess is short for Hypertext Access. It is a configuration file used by Apache-based web servers.
Configuration files are used to set up the initial settings of a program or server. The .htaccess file specifically configures how the server operates.
Each function is represented by a line of text or code that instructs the server on what to do. You can modify the server's behaviour by adding or changing the code within 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 prevent you from accidentally breaking your site, we have disabled certain functions. Do you want to know if you can use a certain function on your one.com web space? 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.
- Go to Files & Security > File Manager in your Control Panel.
You can also access your File Manager via the direct link: https://filemanager.one.com - Click the blue arrow pointing downwards next to the + Upload button.
- Select New other file.
- Name the file .htaccess and press Enter on your keyboard.
- After creating it, you can select the .htaccess file and click Edit to make changes.
You can add different lines of code to the file, depending on the 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?