Indexof

Lite v2.0Webmaster › Fix XenForo Redirecting to Old Domain After VPS Migration › Last update: About

Fix XenForo Redirecting to Old Domain After VPS Migration

Moved XenForo to VPS, but it Redirects to the Old Domain: The Fix

For a webmaster, migrating a XenForo community to a high-performance VPS is a great move for SEO speed and reliability. However, a common technical hurdle after the migration is the "Old Domain Redirect." Even if you have updated your DNS, the web application may stubbornly redirect users—and the Google Search crawler—back to the old server or the old domain name.

This happens because XenForo stores the "Board URL" in several locations within its database and configuration files. Here is the step-by-step diagnostic to break the redirect loop and secure your new environment.

1. Update the Board URL in the Database

XenForo stores your primary domain in the xf_option table. Since you cannot access the Admin Control Panel (ACP) while the redirect is active, you must perform a manual update via phpMyAdmin or the MySQL command line.

  • The Query: SELECT FROM xf_option WHERE option_id = 'boardUrl';
  • The Fix: Update the option_value to your new domain or correct protocol (e.g., https://newdomain.com).
  • Important: Also check the homePageUrl option in the same table if you have a custom home page set.

2. Force the URL in config.php

If the database update doesn't immediately stop the redirect, you can "hard-code" the correct URL in your configuration file. This overrides database settings and is a powerful tool for a webmaster during a migration.

  1. Navigate to your VPS file system: /internal_data/config.php (or src/config.php in XF 2.x).
  2. Add the following line to the end of the file:
$config['boardUrl'] = 'https://your-new-vps-domain.com';

3. Check .htaccess and Nginx Conf

If the redirect persists, the issue might be at the server level rather than the web application level.

  • Apache: Open your .htaccess file. Look for RewriteCond or RewriteRule directives that explicitly mention the old domain or an old IP address.
  • Nginx: Check your server_name block in the site configuration. Ensure it points to the new domain and that there are no hard-coded 301 redirects to the old URL.
  • HTTPS Redirects: Ensure your SSL certificate is valid on the new VPS. If XenForo tries to force HTTPS but the VPS isn't ready, it may default back to a cached redirect.

4. Purge the XenForo Cache

XenForo caches many of its options in the internal_data folder. Even after a database change, the web application might still be reading the old "Board URL" from a cached file.

  • Connect via SSH and navigate to your XenForo root.
  • Run the following command to clear the internal cache: php cmd.php xf:rebuild-caches.
  • If you are using a Service Worker or a CDN like Cloudflare, ensure you "Purge Everything" to prevent the old redirect from being served at the Edge.

5. SEO Implications: The "Crawl Anomaly" Risk

From an SEO perspective, a redirect loop or a redirect to an old domain during a migration is a "Critical Error." If the Google Search web application bot hits these redirects:

  • It may temporarily de-index your threads because it perceives a "Soft 404" or a circular redirect.
  • Check Google Search Console under the "Pages" report for "Redirect error" flags.
  • Once fixed, use the "URL Inspection Tool" to "Test Live URL" and verify that Googlebot sees a 200 OK status on the new VPS IP.

Conclusion

Fixing a XenForo redirect after a VPS move requires a systematic check of the xf_option table, the config.php file, and server-level rewrite rules. By ensuring your web application architecture correctly identifies its new home, you maintain your search engine authority and provide a seamless experience for your forum members. Always remember to clear your browser cache and test in "Incognito Mode" to verify the fix is truly live.

Profile: Migrated your XenForo forum to a new VPS but getting redirected to the old domain? Learn how to update Board URL settings, config.php, and database records. - Indexof

About

Migrated your XenForo forum to a new VPS but getting redirected to the old domain? Learn how to update Board URL settings, config.php, and database records. #webmaster #fixxenfororedirectingtoolddomain


Edited by: Teguh Wijaya & Theodoros Pieris

Close [x]
Loading special offers...

Suggestion