# 🔧 Fix 403 Forbidden Error - Step by Step

## ❌ Problem: Error 403 - Forbidden

Agar `mcp.illumemedia.app` par **403 Forbidden** error aa raha hai, to yeh server configuration issue hai.

---

## ✅ Solutions (Try in Order)

### **Solution 1: Check File Permissions (Most Common)**

Server par file permissions check karo:

```bash
# Files should have 644 permissions
chmod 644 api.php
chmod 644 config.php
chmod 644 utils.php
chmod 644 mcp.php
chmod 644 .htaccess

# Directories should have 755 permissions
chmod 755 .
```

**cPanel mein:**
1. File Manager open karo
2. Files select karo
3. Right-click → "Change Permissions"
4. **644** for files, **755** for folders

---

### **Solution 2: Check .htaccess File**

`.htaccess` file properly uploaded hai?

1. **File Manager** mein check karo
2. `.htaccess` file root directory mein honi chahiye
3. File permissions: **644**

**Agar file missing hai:**
- Project folder se `.htaccess` file upload karo
- Root directory (`public_html` ya `www`) mein upload karo

---

### **Solution 3: Check Directory Index**

`.htaccess` mein directory index allow karo:

```apache
# Allow directory listing (if needed)
Options +Indexes

# Or disable directory listing
Options -Indexes
```

---

### **Solution 4: Check mod_rewrite**

Apache mein `mod_rewrite` enabled hai?

**cPanel:**
1. **Software** → **Select PHP Version**
2. **Extensions** tab
3. `mod_rewrite` enabled hona chahiye

**Or contact hosting provider**

---

### **Solution 5: Check AllowOverride**

`.htaccess` kaam karne ke liye `AllowOverride All` hona chahiye.

**Agar aapke paas server access hai:**
```apache
<Directory /path/to/your/site>
    AllowOverride All
</Directory>
```

**Ya hosting provider se contact karo**

---

### **Solution 6: Temporary .htaccess Fix**

Agar kuch bhi kaam na kare, to simple `.htaccess` use karo:

```apache
# Simple .htaccess - No restrictions
<IfModule mod_rewrite.c>
    RewriteEngine On
</IfModule>

# CORS Headers
<IfModule mod_headers.c>
    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "GET, POST, OPTIONS"
    Header always set Access-Control-Allow-Headers "Content-Type"
</IfModule>
```

---

### **Solution 7: Check File Ownership**

Files ka ownership sahi hai?

```bash
# Check ownership
ls -la

# Change ownership (if needed)
chown username:username api.php
chown username:username config.php
chown username:username utils.php
chown username:username mcp.php
```

**cPanel:**
- File Manager → Files select → "Change Ownership"

---

### **Solution 8: Check Directory Structure**

Files sahi directory mein hain?

```
public_html/
├── api.php
├── config.php
├── utils.php
├── mcp.php
├── .htaccess
└── openapi.yaml
```

**NOT:**
```
public_html/
└── src/
    ├── api.php
    └── ...
```

---

## 🚨 Quick Fix (Emergency)

Agar kuch bhi kaam na kare, to `.htaccess` file temporarily rename karo:

```bash
# Rename .htaccess
mv .htaccess .htaccess.backup

# Test if site works now
# If yes, then .htaccess issue hai
```

---

## ✅ Verification Steps

1. **Test API:**
   ```
   https://mcp.illumemedia.app/api.php?action=test
   ```

2. **Check File Permissions:**
   - Files: 644
   - Folders: 755

3. **Check .htaccess:**
   - File exists?
   - Permissions: 644
   - Content correct?

4. **Check Server Logs:**
   - cPanel → Errors
   - Apache error logs

---

## 📞 Contact Hosting Provider

Agar sab kuch try kar liya aur phir bhi 403 error aa raha hai, to hosting provider se contact karo:

**Questions to ask:**
1. Is `mod_rewrite` enabled?
2. Is `AllowOverride All` set for my directory?
3. Are there any server-level restrictions?
4. Can you check Apache error logs?

---

## 🎯 Most Likely Fix

**90% cases mein yeh fix kaam karta hai:**

1. **File permissions** set karo: **644** for files
2. **.htaccess** file upload karo root directory mein
3. **File ownership** check karo

---

**Need more help?**
- Check server error logs
- Contact hosting support
- Verify file paths

