Redirect Not Working in Cpanel & Htaccess

I have set up a redirect in htaccess which supposedly redirects from mywebsite.com to targetsite.com. The htaccess file looks like this:

# BEGIN Redirects

RewriteEngine On

RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$  [R=301,NC,L,QSA]

# END redirects

RewriteOptions inherit

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Problem is that this configuration does not work at all! And mywebsite.com still brings me to mywebsite.com

Aside from the htaccess or cpanel level, are there any other underlying issues (DNS, nameserver) that might cause this redirect to fail?

5
Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article