Website loading both version www & non www
Now i found the code which is creating problem
Is it safe to remove this code
“`
// Prevents double posts on second page
add_filter(‘redirect_canonical’,’pif_disable_redirect_canonical’);
function pif_disable_redirect_canonical($redirect_url) {
if (is_singular()) $redirect_url = false;
return $redirect_url;
}
“`
1 Answers
Firstly, please contact your hosting and check the hosting configure, or you can add the following code to your .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Please login or Register to submit your answer