Access and modify your .htaccess file
Definitions
An .htaccess file is a configuration file that lets you change settings and control how your hosted websites or apps behave on your hosting account.
Before you start
✅ Each .htaccess file has distinct and varied existing code snippets, this is normal.
ℹ️ New code snippets must be on their own lines to work properly. Also, always click the Save File button at the top right of your .htaccess file to apply changes.
⚠️ Be very careful when editing .htaccess files. It’s recommended that only advanced users or a professional web developer make changes to avoid potential website problems and errors.
🚨Nearly all domain folders have an existing .htaccess file, if your domain does not, you can create one easily. However, make sure to only have one .htaccess file per domain folder.
Step by step
Access your existing .htaccess file
1. Log in to your hosting control panel
2. Click on the File Manager button
3. Double click the domains folder
4. Find your website folder and double-click it. If you have multiple domain names, you will see multiple folders listed, make sure to click on the correct one.
5. Inside your website folder, find the public_html folder and double-click it
6. In the public_html folder of your website, find your .htaccess file. You might need to scroll depending on your device’s screen size and the file count.
🚨 Note: If you don’t see an .htaccess file, you can easily create one using the steps right below.
Create an .htaccess file
1. In your domain public_html folder, click the Create text file button
2. Select Other from the dropdown
3. In the File Name field, type in .htaccess
4. Click the Create button
Modify your .htaccess file
1. Right-click on the .htaccess file and select Edit from the dropdown menu
2. The .htaccess file for your website will now open in a new window. Once open, you can review the current code snippets or make any required modifications.
⚠️ Read these points before you start modifying your .htaccess file:
- ➡️ Each .htaccess file has distinct and varied existing code snippets, this is normal.
- ➡️ Put your code snippet(s) at the top of your .htaccess file. If there’s no room at the top, press ‘Enter’ or ‘Return’ on your keyboard to create space by moving the existing snippets down.
- ➡️ Code block snippet(s) need to be on their own separate line to function properly.
- ➡️ You need to click the Save File button at the top right of your .htaccess file to apply changes.
3. Once you’ve applied edits to your .htaccess file, perform these steps in order:
- Click the Save File button to apply your changes
- Click the X button to close the session