How to Manage Website Files and Permissions

How to Manage Website Files and Permissions

Overview

Your website is made up of files and folders stored on your hosting account. Managing those files correctly is an important part of keeping your website working properly.

Have Freedom Hosting provides several ways to manage your website files, including cPanel File Manager and FTP.

This guide explains how to manage files and folders, understand basic file permissions, and troubleshoot common permission-related problems.


Where Are My Website Files?

For most websites, your primary website files are stored inside:

public_html

You can access this directory through:

cPanel → Files → File Manager

If you have additional domains or subdomains, they may use their own document root directory.

The exact location can be viewed through the Domains section of cPanel.


Managing Files With File Manager

cPanel's File Manager allows you to work with your website files directly from your web browser.

You can use it to:

  • Upload files

  • Download files

  • Create folders

  • Rename files and folders

  • Move files

  • Copy files

  • Delete files

  • Extract ZIP archives

  • Compress files

  • Edit text-based files

  • Change file permissions

  • View hidden files

For many routine tasks, File Manager is the easiest option.


Managing Files With FTP

FTP applications such as FileZilla can also be used to manage website files.

FTP is particularly useful when:

  • Uploading many files

  • Managing a larger website

  • Frequently transferring files

  • Working with a local copy of your website

  • Using a dedicated file-management application

When configuring an FTP application, use the connection information provided by your hosting account rather than assuming a particular server address or port.

Your cPanel Connect Devices or FTP configuration information can provide the appropriate connection details when available.

For security, use a secure connection method supported by your hosting account.


What Are File Permissions?

File permissions determine who can read, write, or execute a file or directory.

On Linux-based hosting systems, permissions are commonly represented using numbers such as:

644
755

You may see these values when using cPanel File Manager or an FTP application.


Common File Permissions

A common configuration for ordinary website files is:

644

This generally allows the file owner to read and modify the file while allowing appropriate read access to other processes.

Directories commonly use:

755

The correct permissions can vary depending on the application, server configuration, and how the file is being used.

Do not change permissions simply because you see a different number.

If your website is working correctly, there may be no reason to change anything.


What Does 644 Mean?

The number represents permissions for three groups:

  1. The file owner

  2. The group

  3. Everyone else

For example, 644 generally means:

  • Owner: read and write

  • Group: read

  • Others: read

This is a common setting for normal website files.


What Does 755 Mean?

755 generally means:

  • Owner: read, write, and execute

  • Group: read and execute

  • Others: read and execute

For directories, the execute permission allows the system to access the contents of the directory.


Avoid Using 777 Unless You Know Why

You may encounter advice online telling you to change a file or directory to:

777

This should not be treated as a standard solution.

Permissions of 777 grant very broad access and can create unnecessary security risks.

If an application is telling you that a file or directory needs 777, stop and investigate the underlying issue first.

On shared hosting, the correct solution may involve:

  • Correct file permissions

  • Correct file ownership

  • Application configuration

  • Server configuration

  • A different directory structure

If you're unsure, contact Have Freedom Hosting Support.


How to Change File Permissions in cPanel

To change permissions through File Manager:

  1. Log in to cPanel.

  2. Open File Manager.

  3. Navigate to the file or folder.

  4. Select the item.

  5. Choose Permissions or Change Permissions.

  6. Review the current permissions.

  7. Make the required change.

  8. Save the new permissions.

  9. Test your website.

Only change permissions when you have a specific reason to do so.


File Ownership Is Different From Permissions

Permissions determine what users and processes are allowed to do with a file.

Ownership determines which system account owns the file.

These are different things.

For example, a website may have perfectly reasonable permissions but still fail because the files are owned by the wrong account.

On shared hosting, customers generally should not attempt to change file ownership themselves.

If you believe your website files have the wrong ownership, contact Have Freedom Hosting Support.


Hidden Files and Dotfiles

Some important website files are hidden by default.

These files often begin with a period:

.htaccess

Other applications may also use hidden configuration files.

If you cannot see a file you know should be present, check whether File Manager is configured to display hidden files.

When opening File Manager, look for the option to Show Hidden Files (dotfiles).

Be careful when modifying hidden files. Some, such as .htaccess, can affect how your entire website operates.


Be Careful With .htaccess

The .htaccess file is commonly used by Apache-based websites to control things such as:

  • Redirects

  • URL rewriting

  • Access rules

  • Security settings

  • PHP-related behavior

  • WordPress permalinks

A small mistake in .htaccess can cause an otherwise working website to return errors.

Before changing it:

  1. Make a backup copy.

  2. Make one change at a time.

  3. Test the website.

  4. Undo the change if it causes a problem.

If you are unsure what a rule does, ask Have Freedom Hosting Support before changing it.


Editing Website Files

File Manager allows you to edit many text-based files directly.

Examples include:

.html
.css
.js
.php
.txt
.htaccess

This can be convenient for making small changes.

However, editing production website files directly is not always the safest approach.

For larger changes:

  1. Keep a backup.

  2. Make the changes locally when practical.

  3. Test them.

  4. Upload the updated files.

  5. Confirm that the website still works.

This makes it much easier to undo a mistake.


Changing Permissions After an Error

A common mistake is to see a website error and immediately change file permissions.

Don't assume permissions are the problem.

For example, a website returning a 500 error could be caused by:

  • A PHP error

  • A broken plugin

  • A bad .htaccess rule

  • An application configuration problem

  • An incompatible PHP version

  • Incorrect file permissions

  • Incorrect ownership

Changing permissions without knowing the cause can make troubleshooting more difficult.


Common Permission-Related Errors

403 Forbidden

A 403 error can sometimes be caused by permissions or access rules.

Other possible causes include:

  • .htaccess rules

  • Directory access restrictions

  • Security settings

  • Application configuration

Check the affected file or directory before changing anything.


500 Internal Server Error

A 500 error does not automatically mean that file permissions are wrong.

Check for:

  • Recent .htaccess changes

  • PHP errors

  • Application errors

  • Plugin or theme problems

  • Incorrect configuration

  • Permission or ownership problems

If the cause isn't obvious, contact support.


"Permission Denied"

A permission-denied message can occur when:

  • A file cannot be read

  • A directory cannot be accessed

  • An application cannot write to a required location

  • An FTP user doesn't have access to a location

  • File ownership is incorrect

Record the exact error before making changes.


WordPress and File Permissions

WordPress needs to be able to read its files and, in certain situations, write to specific directories.

For example, WordPress may need write access when:

  • Uploading media

  • Installing plugins

  • Installing themes

  • Updating certain files

  • Generating cached content

If WordPress reports that it cannot write to a directory, don't immediately set that directory to 777.

The issue may instead be related to ownership, permissions, the WordPress configuration, or the hosting environment.


Before Changing Permissions

Before making significant permission changes:

  1. Create a backup.

  2. Note the original permissions.

  3. Change only what is necessary.

  4. Test the affected website.

  5. Revert the change if it causes problems.

Keeping track of what you changed makes troubleshooting much easier.


File Manager vs. FTP

Both methods can accomplish many of the same tasks.

File Manager FTP
Works from your browser Uses a dedicated application
No additional software required Useful for frequent transfers
Convenient for small changes Better for large transfers
Easy ZIP extraction Convenient for bulk file management
Includes permission controls Depends on the FTP application
Good for quick administration Good for ongoing development

Use whichever method fits the task.


Keep Your Website Organized

A well-organized website is easier to maintain.

Avoid placing unrelated files directly inside public_html when they belong in a specific application or directory.

For example:

public_html/
├── index.php
├── images/
├── css/
├── js/
└── uploads/

The exact structure will depend on your website or application.

WordPress and other applications will have their own directory structures.

Avoid deleting files simply because you don't recognize them. If you're unsure what a file does, investigate it first.


Keep Backups Before Major Changes

Before changing:

  • Permissions

  • .htaccess

  • Application files

  • Configuration files

  • Large groups of files

make sure you have a usable backup.

A backup gives you a way to recover if a change causes unexpected problems.


When to Contact Have Freedom Hosting

Contact Have Freedom Hosting Support if:

  • Files appear to have incorrect ownership.

  • You cannot change permissions when you should be able to.

  • Your website suddenly returns permission-related errors.

  • Files are being changed or recreated unexpectedly.

  • Your application cannot write to a required directory.

  • You suspect a server-side permission problem.

  • You are unsure what permissions a particular application requires.

When contacting support, provide:

  • Your domain

  • The affected file or directory

  • The exact error message

  • What you were attempting to do

  • Any changes you made immediately beforehand

Never include account passwords or other sensitive credentials in a support ticket.


Need Help?

File permissions can be confusing, especially when an issue involves both your website application and the hosting server.

If you're unsure whether a problem is caused by permissions, ownership, your application, or the server environment, Have Freedom Hosting Support can help you determine the appropriate next step.

 

  • 0 utilizatori au considerat informația utilă
Răspunsul a fost util?

Articole similare

How to Chose the Right Website Setup for Your Hosting Account

How to Choose the Right Website Setup for Your Hosting Account Overview There are several ways...

How to Create and Manage a MySQL Database

How to Create and Manage a MySQL Database Overview Many websites and applications use a...

How to use phpMyAdmin

How to Use phpMyAdmin Overview phpMyAdmin is a web-based tool that allows you to manage MySQL...

How to Set Up SSL and HTTPS for Your Website

How to Set Up SSL and HTTPS for Your Website Overview HTTPS protects the connection between a...

How to Create and Manage Cron Jobs

How to Create and Manage Cron Jobs Overview A cron job is a scheduled task that runs...

Powered by WHMCompleteSolution