Our Blog

cPanel 301 Redirects not working on a WordPress site

cpanel, 301 redirects, wordpress website

The Gist:

If you find that the 301 redirects, you have added using cPanel’s “Redirects” tool, are not working on a WordPress site, make sure these redirects are added before the WordPress rewrite rules, in the .htaccess.

Best way to ensure this is to add your redirect rules first, through cPanel, then edit the .htaccess file and move the WordPress rewrite rule (everything between the comments # BEGIN WordPress & # END WordPress) below any redirect rules inserted via cPanel.

The Issue:

cPanel 301 redirects not working on a WordPress site

The Fix:

Move the WordPress rewrite rule below any 301 redirect rules added via cPanel.

Example:

# cPanel Redirect Rule
RewriteCond %{HTTP_HOST} ^yoursite\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/theothersite\.com\/" [R=301,L]
# BEGIN WordPressRewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]# END WordPress

Contact Us Today

This field is for validation purposes and should be left unchanged.

Category

Latest Blog

Contact Us

How Can We Help You?

"*" indicates required fields

This field is for validation purposes and should be left unchanged.