# Enable URL Rewriting
RewriteEngine On

# Remote upload page
RewriteRule ^remote-upload/?$ remote-upload.php [L]

# Set default charset
AddDefaultCharset UTF-8

# Clone page
RewriteRule ^clone/?$ clone-videy.php [L]

# Prevent directory listing
Options -Indexes

# Set max upload size (adjust as needed)
php_value upload_max_filesize 100M
php_value post_max_size 100M
php_value max_execution_time 600
php_value max_input_time 600

# Security Headers
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-XSS-Protection "1; mode=block"
</IfModule>

# Protect config file
<Files "config.php">
    Order Allow,Deny
    Deny from all
</Files>

# Allow video streaming with range requests
<FilesMatch "\.(mp4|webm|ogg|avi|mov)$">
    Header set Accept-Ranges bytes
</FilesMatch>

# Cache static files
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType video/mp4 "access plus 1 year"
    ExpiresByType video/webm "access plus 1 year"
</IfModule>

# Compress text files
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>

# Error pages (optional)
ErrorDocument 404 /index.php
ErrorDocument 403 /index.php