Why is my site redirecting to another domain? Print

  • GHFS Hosting, GHFS cloud hosting, best hosting provider, shared hosting guide, GHFS web hosting, managed hosting services, SSD web hosting, VPS hosting setup, domain and hosting tutorials, how to register a domain, hosting control panel tutorial, DNS configuration guide, hosting knowledge base, how to transfer a domain, SSL installation guide, DNS records explained, email hosting setup, A record guide, MX record setup, SSL certificate troubleshooting, CNAME configuration, WordPress installation GHFS, optimize WordPress performance, WordPress migration guide, FTP upload guide, enable SSH access, fix internal server error, secure VPS server, Linux server commands, MySQL database tutorial, PHP configuration guide, malware removal guide, website security tutorial, DDoS protection GHFS, firewall configuration VPS, secure hosting best practices, disable root login SSH, VPS hosting tutorial, how to manage Linux VPS, cloud server configuration, Nginx setup GHFS, Apache configuration guide, install Docker on VPS, Node.js on VPS, Python hosting tutorial, Redis installation, MySQL optimization, hosting troubleshooting guide, SSL troubleshooting, hosting performance optimization, cPanel tutorial, secure website setup, Plesk tutorial, email deliverability guide, server hardening tutorial, SMTP configuration guide
  • 0

Answer :

f your website suddenly redirects to another domain—especially one you do not own—this usually indicates a configuration issue, malware infection, or DNS problem. This guide explains the most common causes and how to fix them on GHFS Hosting.


1. Check DNS Records (Most Common Issue)

If your domain’s DNS is pointing to the wrong IP address, it may redirect to another site.

What to check:

  1. Log in to GHFS Hosting client panel or your DNS provider

  2. Open DNS Management

  3. Verify these records:

 
 
A → Your GHFS Hosting IP www A → Your GHFS Hosting IP

If the IP belongs to someone else, your site may load their hosting account.

Fix:

  • Correct the IP address

  • Clear browser and DNS cache


2. Check for .htaccess Redirects

A hacked or misconfigured .htaccess file often causes unexpected redirects.

Steps:

  1. Open Plesk → File Manager

  2. Go to:

 
 
/httpdocs/.htaccess
  1. Look for suspicious redirect rules such as:

 
 
RewriteRule ^(.*)$ http://strange-domain.com/$1 [L,R=301]

or encoded/hidden lines.

Fix:

  • Rename .htaccess.htaccess-old

  • Log in to WordPress admin

  • Go to Settings → Permalinks → Save to generate a new clean file


3. Check WordPress Site URL Settings

If WordPress URLs were changed accidentally, your site will redirect.

Check settings:

  1. Log in to WordPress admin

  2. Go to Settings → General

  3. Confirm:

 
 
WordPress Address (URL) Site Address (URL)

These should match your domain.

If you cannot access WordPress admin:

Edit wp-config.php and add:

 
 
define('WP_HOME','https://yourdomain.com'); define('WP_SITEURL','https://yourdomain.com');

4. Check Database for Injected Redirects

Malware may inject redirects into the database.

Steps:

  1. Open phpMyAdmin

  2. Check the wp_options table

  3. Look for strange values in:

  • siteurl

  • home

If changed, fix them manually.

Also check for unusual JavaScript in:

  • widget text fields

  • theme options


5. Check Theme or Plugin Files for Malware

Hackers often insert redirect scripts into:

  • header.php

  • footer.php

  • functions.php

  • index.php

Signs of malware include:

  • Base64-encoded code

  • Random characters

  • Scripts referencing unknown domains

Fix:

  • Replace theme files with fresh copies

  • Disable suspicious plugins

  • Scan with Wordfence or Sucuri


6. Check for Compromised Plugins or Themes

Old or nulled/illegal plugins are a major infection source.

If you installed a theme or plugin from an unreliable source, remove it immediately.


7. Check Cloudflare Page Rules (If Using Cloudflare)

Cloudflare Page Rules may cause unwanted redirects.

Steps:

  1. Log in to Cloudflare

  2. Go to Page Rules

  3. Look for rules like:

 
 
*yourdomain.com* → anotherdomain.com

Disable or delete them.


8. Malware Infection on Server (Common in WordPress)

Redirect malware may come from:

  • Unsafe plugins

  • Outdated WordPress core

  • Infected uploads

  • Compromised FTP credentials

Fix:

  • Run a malware scan using Wordfence

  • Update all plugins/themes

  • Change all passwords (hosting, FTP, WordPress)

  • Delete suspicious files

GHFS Hosting support can perform deeper scans if needed.


9. When to Contact GHFS Hosting Support

You should contact support if:

  • Redirects continue after troubleshooting

  • Malware is suspected

  • Your files were modified without your knowledge

  • DNS looks correct but site still redirects

  • You need help restoring a clean backup

Support can identify infections, repair redirects, and secure your hosting environment.


Was this answer helpful?

« Back