Why You May Need to Edit .htaccess
The .htaccess file is a powerful Apache configuration file that lives in your website’s document root. With it you can:
-
Redirect URLs (301, 302) for SEO or site moves
-
Enable or disable directory browsing
-
Apply custom error pages (404, 500)
-
Add PHP directives or caching rules
-
Restrict access by IP or password-protect folders
On Ucartz Shared Hosting, you have full control over your .htaccess via the cPanel File Manager—so you can make quick tweaks without installing an FTP client or touching the command line.
Before You Begin: Best Practices
-
Backup Your Current
.htaccess.-
Right-click the file in File Manager and select Copy.
-
Name the duplicate
.htaccess.backupso you can restore it if something breaks.
-
-
Use Plain-Text Rules Only.
-
Never paste rich-text or Word-formatted snippets, always use plain-text copy.
-
-
Test in a Staging Folder (Optional).
-
If you have a dev or staging subdomain, edit there first to avoid downtime on your live site.
-
Step-by-Step: Editing .htaccess via cPanel File Manager
-
Log in to cPanel
-
Go to
https://yourdomain.com:2083and enter your cPanel credentials.
-
-
Open File Manager
-
In the Files section, click File Manager.
-
Check Show Hidden Files (dotfiles) if prompted.
-
-
Navigate to Your Document Root
-
For a primary domain, open the
public_html/folder. -
For an addon or subdomain, browse to its specific folder (e.g.,
public_html/blog/).
-
-
Locate the
.htaccessFile-
Scroll until you see
.htaccess. -
If none exists, click + File, name it
.htaccessand hit Create New File.
-
-
Back Up Your File
-
Right-click
.htaccess→ Copy → confirm destination. -
You will now have
.htaccess.copyor.htaccess.backup.
-
-
Edit the File
-
Right-click
.htaccess→ Edit. -
When prompted, leave the encoding at
UTF-8and click Edit. -
The built-in editor opens. Make your changes (e.g., a redirect rule or custom error page).
-
-
Save and Close
-
Click Save Changes in the top-right corner.
-
Close the editor tab when done.
-
-
Test Your Rules
-
In your browser, visit the URLs you modified or redirected.
-
If you see a server error, restore your backup: right-click
.htaccess.backup→ Rename → replace the broken file.
-
Troubleshooting Common Errors
| Error Message | Likely Cause | Fix |
|---|---|---|
| 500 Internal Error | Syntax error or invalid directive | Check for typos, remove recently added lines, restore backup |
| 403 Forbidden | Deny rules blocking your IP or directory browsing | Comment out Deny from lines or whitelist your IP |
| Redirect Loop | Conflicting redirect rules | Consolidate or reorder rules to avoid circular redirects |
Why Ucartz Premium Shared Hosting Makes It Easy
-
Daily Automated Backups keep your
.htaccess(and everything else) safe for seven days -
cPanel File Manager with built-in editor, no FTP or SSH needed
-
24/7 Support if you encounter any issues after editing your configuration
Ready to take full control of your website?
Upgrade or sign up for Ucartz Premium Shared Hosting and enjoy hassle-free hosting with powerful tools at your fingertips.
