=== SITEMAP GENERATOR - COMPLETE SETUP GUIDE === ⚠️ IMPORTANT: Do NOT upload as 'index.php' - it will overwrite your homepage! STEP 1: UPLOAD FILES TO SERVER =============================== 📁 Recommended File Structure: /public_html/ ├── index.php (your existing homepage - DO NOT OVERWRITE) ├── sitemap-generator.php (upload our script with this name) ├── README.md (optional - our documentation) └── sitemap.xml (will be created automatically) 🔧 Upload Instructions: 1. Rename our 'index.php' file to 'sitemap-generator.php' 2. Upload 'sitemap-generator.php' to /public_html/ 3. Upload 'README.md' to /public_html/ (optional, for reference) 4. Set file permissions to 755 (read/write/execute for owner) STEP 2: TEST THE SCRIPT ======================= 🌐 Web Interface Testing: Visit: https://freecdltests.com/sitemap-generator.php - You should see a web interface with 'Generate Sitemap Now' button - Click the button to test sitemap generation - Check if sitemap.xml is created in your public_html folder 🔗 Direct Generation URL: Visit: https://freecdltests.com/sitemap-generator.php?auto=1 - This URL directly generates the sitemap (for bookmarking) - Perfect for testing and manual triggers 📁 Verify Output: Visit: https://freecdltests.com/sitemap.xml - Should show XML content with your website URLs - Check that it includes pages from /public_html/ and /data/tests/ STEP 3: cPANEL ACCESS ===================== 🔐 Login Credentials: URL: https://server144.web-hosting.com:2083 Username: freeyszn Password: d6#$3C%8ZmKEdy2 STEP 4: SETUP DAILY CRON JOB ============================= 📅 Navigate to Cron Jobs in cPanel: 1. Log into cPanel using credentials above 2. Scroll down to 'Advanced' section 3. Click on 'Cron Jobs' icon ⏰ Add New Cron Job (DAILY at 2 AM): Common Settings: Select 'Custom' Time Settings for DAILY execution: Minute: 0 Hour: 2 Day: * Month: * Weekday: * 💻 Command to Run: /usr/bin/php /home/freeyszn/public_html/sitemap-generator.php 📧 Email Notifications: - Enter your email address if you want notifications - Or leave blank to disable email notifications ✅ Save the Cron Job - Click 'Add New Cron Job' - The cron job should appear in your list - It will run automatically every day at 2 AM STEP 5: ALTERNATIVE CRON COMMANDS ================================== If the main command doesn't work, try these alternatives: Option 1 (most common): /usr/bin/php /home/freeyszn/public_html/sitemap-generator.php Option 2 (if Option 1 fails): php -f /home/freeyszn/public_html/sitemap-generator.php Option 3 (for newer PHP versions): /usr/local/bin/php /home/freeyszn/public_html/sitemap-generator.php Option 4 (specific PHP version): /opt/cpanel/ea-php81/root/usr/bin/php /home/freeyszn/public_html/sitemap-generator.php STEP 6: VERIFY CRON JOB IS WORKING =================================== 🕐 Wait 24 hours after setup, then check: 1. Check sitemap.xml timestamp: - Visit: https://freecdltests.com/sitemap.xml - Check if lastmod dates are recent - File should be updated daily 2. Check cron job logs: - In cPanel, go to 'Cron Jobs' - Look for your cron job in the list - Check if it shows 'Last Run' timestamp 3. Check sitemap log file: - Look for: /public_html/sitemap_log.txt - Should contain daily generation entries - Check File Manager in cPanel STEP 7: TROUBLESHOOTING ======================= ❌ If cron job doesn't work: Problem: 'php: command not found' Solution: Try different PHP paths from Step 5 Problem: 'Permission denied' Solution: Set file permissions to 755 Command: chmod 755 /home/freeyszn/public_html/sitemap-generator.php Problem: 'Script not found' Solution: Verify file path is correct Check: /home/freeyszn/public_html/sitemap-generator.php exists Problem: 'No sitemap generated' Solution: Check cPanel Error Logs Location: cPanel → Metrics → Error Logs STEP 8: MANUAL BACKUP METHOD ============================= If automatic cron fails, you can generate manually: Method 1 - Web Browser: Visit: https://freecdltests.com/sitemap-generator.php?auto=1 Bookmark this URL for quick access Method 2 - cPanel File Manager: 1. Open File Manager in cPanel 2. Navigate to public_html 3. Find sitemap-generator.php 4. Right-click → Code Editor → Run in Browser STEP 9: SUBMIT SITEMAP TO SEARCH ENGINES ========================================= 📊 Google Search Console: 1. Go to: https://search.google.com/search-console 2. Add property: freecdltests.com 3. Submit sitemap: https://freecdltests.com/sitemap.xml 🔍 Bing Webmaster Tools: 1. Go to: https://www.bing.com/webmasters 2. Add site: freecdltests.com 3. Submit sitemap: https://freecdltests.com/sitemap.xml STEP 10: MONITORING & MAINTENANCE ================================== 📈 Regular Checks (Monthly): 1. Verify sitemap.xml is updated daily 2. Check sitemap_log.txt for any errors 3. Confirm new pages are automatically included 4. Monitor search console for sitemap status 🔄 If you add new directories: The script automatically scans all subdirectories in: - /public_html/ (for main pages) - /public_html/data/tests/ (for test pages) No configuration changes needed! 📞 SUPPORT ========== If you need help: 1. Check the web interface for error messages 2. Review /public_html/sitemap_log.txt 3. Test manual generation first 4. Contact your hosting provider if cron jobs won't work ✅ SETUP COMPLETE! =================== Your sitemap will now update automatically every day at 2 AM. The sitemap.xml file will always contain your latest pages. Search engines will find new content faster! Expected Results: - Daily sitemap.xml updates - All .html and .php pages included - Test pages from /data/tests/ included - Clean URLs (no query parameters) - SEO-optimized structure 🎉 Your CDL website sitemap automation is now complete!