Server : LiteSpeed
System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User : outerorb ( 1091)
PHP Version : 8.1.34
Disable Function : mail
Directory :  /home2/outerorb/.trash/template-files/

📁 Create New:
⬆️ Upload File:
Current Dir [ Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: update_links.php

Path: /home2/outerorb/.trash/template-files/update_links.php

Size: 1 KB

Permissions: 0666

<?php
// Update internal hrefs to use base_url() helper for portability
require_once __DIR__ . '/inc/config.php';
require_once __DIR__ . '/inc/functions.php';

$files = glob(__DIR__ . '/*.php');
foreach ($files as $file) {
    $baseName = basename($file);
    if (in_array($baseName, ['convert_html_to_php.php','update_links.php'])) continue;
    if ($baseName === 'index.php' || preg_match('/^404\.php$/', $baseName) || $baseName) {
        $content = file_get_contents($file);

        // Replace href="something.php" (not external, not already using base_url)
        $new = preg_replace_callback('/href=\"(?!https?:|mailto:|tel:|#|\\<\?php|\\<?=)([^\"]+?\.php)\"/i', function($m){
            $target = $m[1];
            return 'href="<?= base_url(\'' . $target . '\') ?>"';
        }, $content);

        // Write back if changed
        if ($new !== $content) {
            file_put_contents($file, $new);
            echo "Updated: $file\n";
        }
    }
}

echo "Done updating links.\n";

← Back to Directory Edit File 🔒 Chmod

WP File Manager