File Permissions & Structure

What Are File Permissions?

File permissions control who can read, write, and execute files:
- Read - Can view file content
- Write - Can modify/edit file
- Execute - Can run/execute file

Permission Numbers Explained

Permissions shown as numbers (644, 755, etc.):
- First digit - Owner permissions
- Second digit - Group permissions
- Third digit - Public permissions

Each digit: 4 = read, 2 = write, 1 = execute

Standard Web Hosting Permissions

  • HTML/CSS/JS files - 644 (readable by public)
  • Folders - 755 (readable and executable by public)
  • Never use 777 - Security risk

Setting Permissions in File Manager

  1. Right-click a file/folder
  2. Select Permissions or Change Permissions
  3. Enter correct number (644 for files, 755 for folders)
  4. Click Save or Apply

Setting Permissions with FTP Client

  1. Right-click file in FTP client
  2. Select Properties or Permissions
  3. Adjust as needed
  4. Click OK to apply

Correct File Structure

Important for links and resources to work:

Correct Structure:
public_html/
├── index.html
├── about.html
├── css/
│ └── style.css
├── js/
│ └── script.js
└── images/
└── logo.png

Links must reference correct paths:
- In index.html: <link href="css/style.css">
- In about.html: <link href="css/style.css">
- Image in about.html: <img src="images/logo.png">

Important: No Nested Folders

Don't nest template in extra folder:
❌ Wrong:
public_html/
└── my-template/
├── index.html

✅ Right:
public_html/
├── index.html

If your template is nested:
1. Open my-template folder
2. Move all files UP to public_html
3. Delete now-empty my-template folder
4. Test links work

Path Reference Examples

Linking CSS from HTML:

Image paths:

Logo

Logo

JavaScript paths:

Common Path Issues

Issue: "404 Not Found" for CSS/images
- Check file structure
- Verify file exists in folder
- Check path references in HTML
- Use ../ if file in parent folder

Issue: Images don't show
- Check image file exists
- Verify correct folder path
- Check file name (case-sensitive on Linux)
- Verify permissions (644)

Issue: JavaScript not working
- Check script path correct
- Verify script.js file uploaded
- Check for JavaScript errors (see browser console)
- Check permissions

Verifying Structure

Use your FTP client or file manager to verify:
1. All HTML files in root
2. All CSS in css/ folder
3. All images in images/ folder
4. All JS in js/ folder
5. No extra nested folders

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us