cPanel redirect not working.
In my wordpress domain, I have set redirect from cPanel to redirect a non-existent directory under the domain to one of my wordpress post. The redirect was not working.
Reason : The default wordpress htaccess rule in the .htaccess file (given below)was causing the issue.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Fix : give the cpanel redirect rule just above the default htaccess rule in the .htaccess
Reason : The default wordpress htaccess rule in the .htaccess file (given below)was causing the issue.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Fix : give the cpanel redirect rule just above the default htaccess rule in the .htaccess