Site Builder
Editing:
Homepage-Redirect.php
writable 0666
<?php /* Plugin Name: Index.html Homepage Redirect Description: Redirects the homepage to index.html if it exists. Version: 1.0 Author: BestDealOn */ add_action('template_redirect', function() { // Only on homepage/root (not admin, not AJAX) if (!is_admin() && is_front_page() && !is_feed() && !is_preview()) { // Find physical index.html in the WordPress root $index_html_path = ABSPATH . 'index.html'; if (file_exists($index_html_path)) { // Use home_url to build proper redirect $url = home_url('/index.html'); // Prevent endless redirect if already on /index.html if (untrailingslashit($_SERVER['REQUEST_URI']) === '/index.html') return; wp_redirect($url, 307); exit; } } });
Save changes
Create folder
writable 0777
Create
Cancel